Part Number Hot Search : 
N4141 MRF500 MJD122T4 STC8550S 1N5364 S0100 IRF6616 2N1873A
Product Description
Full Text Search
 

To Download AS6133 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  user?s manual target devices pd6133 series pd6604 series pd63 series pd67 series AS6133 ver.2.21 or later assembler for pc-9800 (ms-dos tm based) for ibm pc/at tm (pc dos tm based) document no. u10115ej3v0um00 (3rd edition) date published august 2001 j cp(k) printed in japan 1999 ? 1995
2 user?s manual u10115ej3v0um [memo]
user?s manual u10115ej3v0um 3 ms-dos, windows, and windowsnt are either registered trademarks or trademarks of microsoft corporation in the united states and/or other countries. pc/at and pc-dos are trademarks of international business machines corporation in the usa. m8e 00. 4 the information in this document is current as of june, 2001. the information is subject to change without notice. for actual design-in, refer to the latest publications of nec's data sheets or data books, etc., for the most up-to-date specifications of nec semiconductor products. not all products and/or types are available in every country. please check with an nec sales representative for availability and additional information. no part of this document may be copied or reproduced in any form or by any means without prior written consent of nec. nec assumes no responsibility for any errors that may appear in this document. nec does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from the use of nec semiconductor products listed in this document or any other liability arising from the use of such products. no license, express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of nec or others. descriptions of circuits, software and other related information in this document are provided for illustrative purposes in semiconductor product operation and application examples. the incorporation of these circuits, software and information in the design of customer's equipment shall be done under the full responsibility of customer. nec assumes no responsibility for any losses incurred by customers or third parties arising from the use of these circuits, software and information. while nec endeavours to enhance the quality, reliability and safety of nec semiconductor products, customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. to minimize risks of damage to property or injury (including death) to persons arising from defects in nec semiconductor products, customers must incorporate sufficient safety measures in their design, such as redundancy, fire-containment, and anti-failure features. nec semiconductor products are classified into the following three quality grades: "standard", "special" and "specific". the "specific" quality grade applies only to semiconductor products developed based on a customer-designated "quality assurance program" for a specific application. the recommended applications of a semiconductor product depend on its quality grade, as indicated below. customers must check the quality grade of each semiconductor product before using it in a pa rticular application. "standard": computers, office equipment, communications equipment, test and measurement equipment, audio and visual equipment, home electronic appliances, machine tools, personal electronic equipment and industrial robots "special": transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster systems, anti-crime systems, safety equipment and medical equipment (not specifically designed for life support) "specific": aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life support systems and medical equipment for life support, etc. the quality grade of nec semiconductor products is "standard" unless otherwise expressly specified in nec's data sheets or data books, etc. if customers wish to use nec semiconductor products in applications not intended by nec, they must contact an nec sales representative in advance to determine nec's willingness to support a given application. (note) (1) "nec" as used in this statement means nec corporation and also includes its majority-owned subsidiaries. (2) "nec semiconductor products" means any semiconductor product developed or manufactured by or for nec (as defined above). ? ? ? ? ? ?
4 user ? s manual u10115ej3v0um regional information some information contained in this document may vary from country to country. before using any nec product in your application, piease contact the nec office in your country to obtain a list of authorized representatives and distributors. they will verify: ? device availability ? ordering information ? product release schedule ? availability of related technical literature ? development environment specifications (for example, specifications for third-party tools and components, host computers, power plugs, ac supply voltages, and so forth) ? network requirements in addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary from country to country. nec electronics inc. (u.s.) santa clara, california tel: 408-588-6000 800-366-9782 fax: 408-588-6130 800-729-9288 nec electronics (germany) gmbh duesseldorf, germany tel: 0211-65 03 02 fax: 0211-65 03 490 nec electronics (uk) ltd. milton keynes, uk tel: 01908-691-133 fax: 01908-670-290 nec electronics italiana s.r.l. milano, italy tel: 02-66 75 41 fax: 02-66 75 42 99 nec electronics (germany) gmbh benelux office eindhoven, the netherlands tel: 040-2445845 fax: 040-2444580 nec electronics (france) s.a. velizy-villacoublay, france tel: 01-3067-5800 fax: 01-3067-5899 nec electronics (france) s.a. madrid office madrid, spain tel: 091-504-2787 fax: 091-504-2860 nec electronics (germany) gmbh scandinavia office taeby, sweden tel: 08-63 80 820 fax: 08-63 80 388 nec electronics hong kong ltd. hong kong tel: 2886-9318 fax: 2886-9022/9044 nec electronics hong kong ltd. seoul branch seoul, korea tel: 02-528-0303 fax: 02-528-4411 nec electronics singapore pte. ltd. novena square, singapore tel: 253-8311 fax: 250-3583 nec electronics taiwan ltd. taipei, taiwan tel: 02-2719-2377 fax: 02-2719-5951 nec do brasil s.a. electron devices division guarulhos-sp, brasil tel: 11-6462-6810 fax: 11-6462-6829 j01.2
user?s manual u10115ej3v0um 5 major revisions in this edition page description deleting description "separate volume of sm6133" or "supplied with sm6133" because AS6133 assembler is separated from sm6133 simulator changing supported debugger from nec's sm6133 simulator to naito densei machida mfg's eb-6133 throughout adding target device preface changing description of 2.1 pc-9800 series , 2.2 ibm pc/at compatibles , and 3.1 assembler p.45 adding description to part i , 3.4 pseudo instructions and control instructions p.74 adding part ii , 1.2 supported debugger p.75 adding 2.2 install p.77 adding table 3-1 device name that can be described and supported device p.87 changing description of [example] in 4.4.2 starting the assembler p.102 adding description to 5.4.1 error check for instructions exceeding the allowable number of bits p.103 changing description in 5.4.3 check for the destination of a branch instruction (automatic check on bank0 and bank1) p.104 adding description to 5.4.5 check for input/output instructions for nonexisting ports p.112 adding appendix a constraints p.113 adding appendix b revision history the mark shows major revised points.
user?s manual u10115ej3v0um 6 preface 1. the AS6133 assembler supports under the following 4-bit microcontrollers. series name supported device pd6133 pd6132, 6132a, 6133, 6134, 6135, 61p34b pd6604 pd6603, 6604, 6605, 66p04b pd63 pd62, 62a, 63, 63a, 64, 64a, 6p4b, 65, 6p5 pd67 pd67, 68, 69, 6p9 2. the AS6133 assembler runs under the following environment: 2.1 pc-9800 series (1) supported pc-9800 series os ms-dos ver.5.0 or later note 1 windows tm 3.1/95/98 note 2 windowsnt tm 4.0 note 2 notes 1. versions 5.00 and 5.00a feature a task swap function. however, this software does not support the use of this function. 2. can be used with ms-dos prompt (windows 3.1/95/98) or command prompt (windowsnt). the AS6133 assembler runs on ms-dos for nec's pc-9800 series or windows, or windows for pc-9800 series supplied by microsoft. nec will not be liable for unsatisfactory operation of this assembler under another commercially available version of ms-dos or windows. the config.sys file must contain the following settings: ? files = 15 (15 or more) ? buffers = 10 (10 or more)
user?s manual u10115ej3v0um 7 2.2 ibm pc/at compatibles (1) supported ibm pc/at compatibles ibm pc/at compatible personal computers on which the following os runs: (2) supported ibm pc/at compatible oss ms-dos ver.6.0 or later note 1 pc dos ver.6.1 or later note 1 windows 3.1/95/98 note 2 windowsnt 4.0 note 2 notes 1. versions 6.0 and 6.1 feature a task swap function. however, this software does not support the use of this function. 2. can be used with ms-dos prompt (windows 3.1/95/98) or command prompt (windowsnt). the AS6133 assembler runs on ms-dos or windows for ibm pc/at compatibles supplied by microsoft, or pc dos for ibm pc/at compatibles supplied by ibm japan. nec will not be liable for unsatisfactory operation of this assembler under another commercially available version of ms-dos, windows, or pc dos. 3. supply media 3.1 assembler (1) file name AS6133.exe (2) floppy disk types pc-9800 series: high-density 3.5-inch floppy disk (3.5" 2hd) ibm pc/at compatibles: high-density 3.5-inch floppy disk (3.5" 2hd) 4. symbols used in this manual ... the preceding option may be repeated any number of times. [ ] the options enclosed in parentheses may be omitted. { } only one of the options in the braces must be selected. ? one single-byte space or tab. " " used to enclose a character or character string. cr carriage return lf line feed tab horizontal tab represents any character string. represents any character string. represents any character string. indicates corresponding contents. < > represents data equivalent to the enclosed item.
user?s manual u10115ej3v0um 8 5. file naming rules [drive-name:] [\directory-name\...] file-name [.extension] drive-name: drive in which the floppy disk containing the file is mounted. omitting the drive name causes the current drive to be assumed. file-name: string of up to eight single-byte or four double-byte characters. extension: string of up to three single-byte characters.
user?s manual u10115ej3v0um 9 contents part i language chapter 1 overview.......................................................................................................... ................15 1.1 overview of the assembler ................................................................................................. ..........15 1.1.1 what is an assembler?................................................................................................... ....................15 1.1.2 what is an absolute assembler? .......................................................................................... ..............15 1.1.3 what is a relocatable assembler? ........................................................................................ ..............16 1.1.4 flow of system development using the pd6133 series ...................................................................16 1.1.5 comparison of assemblers................................................................................................ .................19 1.2 functional overview of pd6133 series assembler ..................................................................19 1.2.1 creating a sequence file................................................................................................ .....................19 1.2.2 creating source module files............................................................................................ ..................19 1.2.3 supported japanese code ................................................................................................. ................20 1.2.4 external module definition reference function ........................................................................... .........20 1.2.5 assembly................................................................................................................ ............................22 1.3 before starting program development....................................................................................... .24 1.3.1 restrictions on symbols ................................................................................................. ....................24 1.3.2 restrictions on pseudo instructions..................................................................................... ...............24 1.3.3 notes on using japanese code ............................................................................................ ..............24 1.3.4 setting the date and time of the host machine ........................................................................... ........25 1.3.5 restrictions on the number of source modules ............................................................................ ......25 chapter 2 coding source programs......................................................................................26 2.1 basic configuration of a source program ..................................................................................2 6 2.2 configuration of a statement.............................................................................................. ..........26 2.3 tabulation function....................................................................................................... ................27 2.4 character sets............................................................................................................ ....................28 2.4.1 alphanumeric characters................................................................................................. ...................28 2.4.2 digits .................................................................................................................. ................................28 2.4.3 special characters...................................................................................................... ........................29 2.5 symbol field .............................................................................................................. .....................30 2.5.1 rules governing the writing of symbols .................................................................................. ............31 2.6 mnemonic field ............................................................................................................ ..................32 2.7 operand field ............................................................................................................. ....................32 2.7.1 operand field entry types ............................................................................................... ....................32 2.8 comment field ............................................................................................................. ..................35 2.9 expressions and operators ................................................................................................. .........36 2.9.1 expressions............................................................................................................. ...........................36 2.9.2 overview of operators ................................................................................................... .....................36 2.9.3 arithmetic operators .................................................................................................... .......................37 2.9.4 logical operators....................................................................................................... .........................38 2.9.5 comparison operators.................................................................................................... ....................39 2.9.6 shift operators......................................................................................................... ...........................40 2.9.7 other operators ......................................................................................................... .........................41
user?s manual u10115ej3v0um 10 chapter 3 pseudo instructions and control instructions..................................... 42 3.1 outline of pseudo instructions and control instructions......................................................... 42 3.2 pseudo instructions....................................................................................................... ............... 42 3.3 control instructions ...................................................................................................... ................ 44 3.4 pseudo instructions and control instructions........................................................................... 45 3.5 macro function............................................................................................................ .................. 69 3.5.1 macro definition and applicable range ................................................................................... ............ 69 3.5.2 macro reference ......................................................................................................... ....................... 71 3.5.3 macro expansion ......................................................................................................... ...................... 72 part ii operation chapter 1 product overview................................................................................................. .... 74 1.1 product description ....................................................................................................... ............... 74 1.2 supported debugger........................................................................................................ ............. 74 1.3 system configuration ...................................................................................................... ............. 74 chapter 2 before execution ................................................................................................. ..... 75 2.1 creating a backup file.................................................................................................... .............. 75 2.2 install ................................................................................................................... ........................... 75 chapter 3 sequence file .................................................................................................... .......... 76 3.1 overview.................................................................................................................. ....................... 76 3.2 sequence file format ...................................................................................................... ............. 76 3.2.1 overall format.......................................................................................................... .......................... 76 3.2.2 device name format ...................................................................................................... .................... 77 3.2.3 assembly option format .................................................................................................. ................... 78 3.2.4 source file name format ................................................................................................. ................... 78 3.3 example of a sequence file description .................................................................................... 79 chapter 4 assembler functions .............................................................................................. 80 4.1 overview.................................................................................................................. ....................... 80 4.2 assembly input/output files............................................................................................... ......... 81 4.3 assembler functions....................................................................................................... ............. 82 4.3.1 intermediate object module file output function ......................................................................... ........ 82 4.3.2 linkage function ........................................................................................................ ........................ 82 4.3.3 pro file output function................................................................................................ ..................... 82 4.3.4 assembly time reduction function........................................................................................ .............. 82 4.3.5 assembly list file output function ...................................................................................... ................. 84 4.3.6 cross-reference list file output function ............................................................................... .............. 85 4.4 assembler start-up procedure .............................................................................................. ...... 86 4.4.1 input files needed when the assembler starts ............................................................................ ....... 86 4.4.2 starting the assembler.................................................................................................. ..................... 86 4.4.3 aborting assembly ....................................................................................................... ...................... 87 4.5 assembly options.......................................................................................................... ............... 88 4.5.1 option to control eb-6133 emulator information output................................................................... .. 89 4.5.2 option to control object file output .................................................................................... ................. 90 4.5.3 option to control load module file (pro file) output .................................................................... ...... 91
user?s manual u10115ej3v0um 11 4.5.4 option to control assembly list file output ............................................................................. ..............92 4.5.5 option to control cross-reference list file output ...................................................................... ...........93 4.5.6 option to control the number of lines to be output on one list output page (row no.) .....................94 4.5.7 option to control the number of columns to be output on one list output line .....................................94 4.5.8 option to control option information output............................................................................. ............95 4.5.9 tab control option ...................................................................................................... ........................95 4.5.10 form feed control option ............................................................................................... ...................96 4.5.11 option to control assembly-time variables.............................................................................. ..........96 4.5.12 option to control a work drive......................................................................................... ..................97 4.5.13 option to control list header output ................................................................................... ...............97 4.5.14 help message display ................................................................................................... ...................98 chapter 5 assembly output lists........................................................................................... .99 5.1 types of assembly output lists ............................................................................................ ......99 5.2 controlling each list output format....................................................................................... ..100 5.3 header output ............................................................................................................. .................101 5.4 assembler's check functions............................................................................................... .....102 5.4.1 error check for instructions exceeding the allowable number of bits................................................102 5.4.2 check to prevent a program crash ........................................................................................ ...........102 5.4.3 check for the destination of a branch instruction (automatic check on bank0 and bank1) ...........103 5.4.4 check for output to an input-only port .................................................................................. ............104 5.4.5 check for input/output instructions for nonexisting ports............................................................... ...104 chapter 6 error messages ................................................................................................... ....105 6.1 errors detected at start-up and run time................................................................................10 5 appendix a constraints ...................................................................................................... .........112 appendix b revision history ................................................................................................ ......113
user?s manual u10115ej3v0um 12 list of figures figure no. title page part i language 1-1 system development flow..................................................................................................... ........................17 1-2 software development flow ................................................................................................... .......................18 1-3 creating source module files ................................................................................................ ........................21 1-4 creating object files....................................................................................................... ...............................23 part ii operation 4-1 processing flow of the assembly time reduction function..................................................................... .....83 4-2 AS6133 input/output file configuration...................................................................................... ...................85
user?s manual u10115ej3v0um 13 list of tables table no. title page part i language 1-1 comparison of assemblers .................................................................................................... ........................19 1-2 pseudo instructions which can be nested and maximum nesting levels ...................................................24 2-1 operator priorities......................................................................................................... .................................36 3-1 pseudo instructions and control instructions................................................................................ .................45 part ii operation 3-1 device name that can be described and supported device ...................................................................... .77 4-1 assembly options ............................................................................................................ ..............................88 5-1 output lists................................................................................................................ ....................................99
user?s manual u10115ej3v0um 14 part i language
user?s manual u10115ej3v0um 15 chapter 1 overview 1.1 overview of the assembler 1.1.1 what is an assembler? a microcontroller can only interpret its so-called machine language, which consists entirely of 0s and 1s. machine language is very complicated for humans to understand and essentially impossible to remember. by assigning symbolic (assembly) language instructions to machine language instructions, however, programs can be coded in such a way that humans can more easily understand them. an assembler is a program which translates this "human- friendly" symbolic language, into the machine language of the microcontroller. processing 1: mov a,mem1 rlz a scaf jnc processing 2 assembly language (symbolic language) assembler 1111111011100010 1111111011110011 1111101011110011 1110110111110001 machine language assemblers can be classified as absolute assemblers or relocatable assemblers. AS6133 is an absolute assembler. unlike conventional absolute assemblers, however, it allows split programming. thus, although it is actually an absolute assembler, AS6133 can be said to have characteristics similar to those of a relocatable assembler. 1.1.2 what is an absolute assembler? a machine language instruction consists of an instruction and data. an instruction specifies an operation to be performed by the microcontroller. data is the value(s) on which that operation is performed. data can include the constants and variables to be used to perform an arithmetic instruction. an absolute assembler makes the addresses assigned to instructions and data absolute upon translating them into machine language. this means that addresses and data must be determined before the program is assembled. the information is passed to the assembler by the location counter control pseudo instruction called "org". the machine language code created by the absolute assembler is stored in memory as is and executed by the microcontroller. the machine language code thus created is called an absolute object module. on the other hand, the source symbolic language code is called a source module.
part i chapter 1 overview 16 user ? s manual u10115ej3v0um 1.1.3 what is a relocatable assembler? the absolute object module created by an absolute assembler has absolute data and addresses. on the other hand, an assembler which creates an object module which can be relocated to any address in memory is called a relocatable assembler. the machine language code created by a relocatable assembler is called a relocatable object module. a relocatable object module cannot be directly executed as a program by the microcontroller. this is because addresses and data are relative. a program which translates a relocatable object module such that it can be executed by the microcontroller is called a linker. what is a linker? a linker determines the location of one or more relocatable object modules created by a relocatable assembler, resolves address references, and combines the modules into one. it also assigns absolute values to those addresses and data to which relative values were assigned. the combination of modules produced by the linker is called a load module. this load module cannot be directly executed by the microcontroller. it must, therefore, be translated into a form that can be executed by the microcontroller. 1.1.4 flow of system development using the pd6133 series figure 1-1 shows the flow of system development using the pd6133 series. figure 1-2 shows the flow of software development in detail.
part i chapter 1 overview user ? s manual u10115ej3v0um 17 figure 1-1. system development flow product planning system design finalization of specifications hardware development logic design (circuit/mechanism design) software development software design evaluation end of development
part i chapter 1 overview 18 user ? s manual u10115ej3v0um figure 1-2. software development flow software development preparation of program specifications preparation of flowchart coding assembly errors detected? debugging system evaluation ok? programs and equipment to be used (product names) editor assembler (AS6133) eb-6133 emulator yes no no yes
part i chapter 1 overview user ? s manual u10115ej3v0um 19 1.1.5 comparison of assemblers table 1-1 lists the features of absolute and relocatable assemblers. table 1-1. comparison of assemblers absolute assembler relocatable assembler assembly method batch assembly (AS6133 allows pseudo split assembly.) split assembly link addresses on the assembly list absolute relative restrictions on operations performed on variables in the operand part none imposed by the linker. variable local variable cannot be defined. (can be defined for AS6133.) can be defined. others because batch assembly is used, partially modifying the source does not reduce the assembly time. (AS6133 can realize a reduction, however, because it allows pseudo split assembly.) address calculation is necessary during debugging. because split assembly is supported, module-by-module programming by more than one person is possible. 1.2 functional overview of pd6133 series assembler 1.2.1 creating a sequence file the pd6133 series assembler (AS6133) is an absolute assembler. despite being an absolute assembler, AS6133 supports module programming, one of the features of a relocatable assembler. unlike relocatable assembler packages, however, AS6133 does not provide a linker program. the features of a linker are, however, supported. when programming source modules, a sequence file which describes the order in which the source module files are to be linked is necessary. the sequence file also specifies device names and assembly-time options, in addition to the order in which the source module files are to be linked. 1.2.2 creating source module files when designing a program, it is generally divided into several subprograms, according to function. if the functional independence of the subprograms is high, the debugging of each subprogram will be easy. this enhances the development efficiency and will lead to better maintainability in the future. a subprogram is a unit of coding and also acts as the unit of input to the assembler. the unit of input to the assembler is called a source module. once the coding of a source module has been completed, use an editor to write the module to a file. the created file is called a source module file. when a source program is split into source modules, the order in which the source modules are to be linked must be written in a sequence file. splitting into files using include statements differs from the above-mentioned splitting into source modules. more specifically, a file specified by an include pseudo instruction can be said to be part of the source module containing the include pseudo instruction.
part i chapter 1 overview 20 user ? s manual u10115ej3v0um 1.2.3 supported japanese code AS6133 can assemble source programs written in japanese code (8-bit jis code and shift jis code). japanese code can be used not only in comment fields but also in symbol fields. 1.2.4 external module definition reference function the public and extrn pseudo instructions can be used to reference symbols defined in external modules. a symbol for which public is declared can be referenced with the extrn declaration at any time. the symbols defined in backward modules can be referenced at assembly time while those defined in forward modules can be referenced at link time.
part i chapter 1 overview user ? s manual u10115ej3v0um 21 figure 1-3. creating source module files source program source module a writing to files (using editor) source module files source module b end source module c end include 'sub.asm' end sub.asm source module d end source module a end
part i chapter 1 overview 22 user ? s manual u10115ej3v0um 1.2.5 assembly to assemble a source module, the following files are necessary: ? assembler (AS6133.exe) ? source module file ( .asm, .asm, etc.) ? sequence file ( .seq) when starting AS6133, the output list can be controlled directly from the console or by specifying assembly options in the sequence file. if any errors are found in the assembly list, modify the source modules and repeat assembly until all errors have been removed. if the source program consists of modules, AS6133 creates intermediate object module files (.obj) at assembly. these intermediate object module files are used when the source program is partially modified and re-assembled. to reduce the assembly time, AS6133 re-assembles modified source modules only, using the already created intermediate object module files for those source modules that have not been modified. to check whether a source module has been modified, the assembler compares the creation date and time of the source module file with that of the intermediate object module file having the same name. if the source module file is found to be newer, it is judged to have been modified. if, therefore, the intermediate object module file corresponding to a source module file is not found, or if the source module file is older, the assembler automatically detects this and creates an intermediate object module file at assembly. the assembly time reduction function can reduce the assembly time considerably as the user proceeds with debugging.
part i chapter 1 overview user ? s manual u10115ej3v0um 23 figure 1-4. creating object files source module files assembly list file assembly list (.prn) cross-reference (.xrf) errors detected? modification of source module files modified source module files intermediate object module files (.obj) object files (.pro) ok! no yes (AS6133)
part i chapter 1 overview 24 user?s manual u10115ej3v0um 1.3 before starting program development this section explains those items with which the user must be familiar to enable efficient use of AS6133. the subsequent sections provide a detailed explanation of the above. 1.3.1 restrictions on symbols (1) restrictions on the number of symbols each source module can use a symbol table area of up to 64 kb. with AS6133, one symbol can be defined using up to 253 characters (one byte per character). note the maximum number of symbols that can be used is as follows: 240 if all symbols are 253 characters long. 3,368 if all symbols are eight characters long. note double-byte characters (shift jis codes) consist of two bytes each. (2) symbols in a macro those symbols which are not declared as being global are handled as local symbols. 1.3.2 restrictions on pseudo instructions the macro, rept, and if statements can be nested to up to 40 levels deep. when expanding pseudo instructions in a pseudo instruction, care must be exercised to prevent the nesting level from exceeding 40. in a macro, macro name references can be made but macro definitions cannot be created. table 1-2. pseudo instructions which can be nested and maximum nesting levels pseudo instruction which can be nested maximum nesting levels total rept-exitr-endr 8 if-else-endif 40 macro-endm 40 40 include 8 8 note note the include statement can be nested independently of the above pseudo instructions. 1.3.3 notes on using japanese code a source list can be created by using a japanese editor. the available character codes are 8-bit jis (single-byte) codes and shift jis (double-byte) codes. reserved words must be written using single-byte codes. a double-byte space, colon, and semicolon must not be used to delimit symbol, mnemonic, and operand fields. the single-byte and double-byte codes for characters are different. for example, when a space is coded using a double-byte code, it is handled as a blank, not as a delimiter.
part i chapter 1 overview user ? s manual u10115ej3v0um 25 1.3.4 setting the date and time of the host machine always check the current date and time when starting ms-dos on the host machine (pc-9800 series). at assembly time, AS6133 compares the creation dates and times of the source module files with those of the intermediate object module files having the same names. as a result of this comparison, if an intermediate object module file is found to be newer, the corresponding source module is not assembled. if the time indicated by the clock of the host machine is subsequent to the creation date and time of a source module file, changes made to the source module file may not take effect after assembly. 1.3.5 restrictions on the number of source modules AS6133 can assemble a source program consisting of up to 30 modules. the source modules are handled as a single source program by describing the assembly order in a sequence file (.seq).
user?s manual u10115ej3v0um 26 chapter 2 coding source programs 2.1 basic configuration of a source program a source program consists of one or more source modules, as shown in figure 1-3. each source module consists of one or more statements. the configuration of a statement is shown in section 2.2 . no restrictions are imposed on the size of a source module. this means that any number of statements can be written. a source program can consist of up to 30 source modules. in a source program, instructions, pseudo instructions, and control instructions can be written at any location. the end pseudo instruction, however, can be written only at the end of each source module. the end pseudo instruction need not be written in an include file to be read into a source module by the include pseudo instruction in the source module. 2.2 configuration of a statement a source program in assembler language consists of statements. a statement is written using the characters listed in section 2.4 . when creating a source program using a text editor, each statement is terminated with a cr (carriage return) code and an lf (line feed) code. the assembler regards an lf code as being a statement terminator, but ignores a cr code. a statement consists of four fields: symbol, mnemonic, operand, and comment, as shown below. each field must be delimited with a single-byte space ( ) (8-bit jis code 20h), tab code (09h), single-byte colon (:) (3ah), or single-byte semicolon (;) (3bh). up to 256 characters can be written on one line. the format of a statement is arbitrary. the symbol, mnemonic, operand, and comment fields can start in any columns provided that they appear in this order. a statement containing only a symbol or comment field, as well as an empty statement can also be written. symbol field mnemonic field operand field comment field lf <1> <2> <3> <1> to enter a symbol in a symbol field, use a single-byte colon or blank (one or more single-byte spaces or tab code) as a delimiter. whether a colon or blank should be used depends on the instruction to be written in the mnemonic field. <2> when an operand field is necessary, use a blank as a delimiter. <3> when a comment is written in the comment field, use a single-byte semicolon as a delimiter. <4> any number of blanks can be inserted before and after a colon or semicolon. in example 1, a colon is used to delimit the symbol and mnemonic fields. in example 2, a blank is used.
part i chapter 2 coding source programs user?s manual u10115ej3v0um 27 [example 1] aaa : mov a,#8h ; a=8h [example 2] aaa equ 7 2.3 tabulation function AS6133 provides a tabulation function to improve the readability of an assembly listing. the tabulation function re- arranges the symbol, mnemonic, operand, and comment fields in a source program so that they each begin in a column that is a multiple of eight. [example] addition: mov a,#8h mov r01,a ;r01=8h columns that are multiples of eight (column numbers equal to the tab number, multiplied by eight) to use the tabulation function, insert a tab (horizontal tab, 09h) code in the source program before each of the mnemonic and operand fields and before the single-byte semicolon (;) indicating the start of a comment field. symbol mnemonic operand ; comment "tab" "tab" "tab" AS6133 supports an assembly option which allows the user to select whether the tab code (09h) should be sent to the printer or replaced by single-byte spaces, depending on the printer being used. this option is provided to support printers which cannot recognize tab codes. in this way, AS6133 allows the user to specify that a tab code should be converted to single-byte spaces before being sent to the printer. remark it is recommended that the tab code be used to make effective use of the disk.
part i chapter 2 coding source programs 28 user?s manual u10115ej3v0um 2.4 character sets the 8-bit jis code set and the shift jis code set must be used to write statements. restrictions are imposed on the characters that can be used for symbols. for details, see section 2.5.1 . reserved words can be used either single-byte alphabetic upper or lower cases. symbols defined by the user, however, are case sensitive. [example 1] aaa equ 3 aaa equ 5 aaa and aaa are regarded as being different symbols. [example 2] mov mem1,#1 mov mem1,#3 mem1 and mem1 are different symbols. mem1 is set to 1 and mem1 to 3. the reserved word mov, however, is interpreted as being identical to mov. 2.4.1 alphanumeric characters single-byte alphabetic characters and arabic numerals are collectively referred to as alphanumeric characters. 2.4.2 digits binary digits: the two digits 0 and 1 are referred to as binary digits. octal digits: the eight digits 0, 1, 2, 3, 4, 5, 6, and 7 are referred to as octal digits. decimal digits: the ten digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 are referred to as decimal digits. hexadecimal digits: the sixteen digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, and f are referred to as hexadecimal digits.
part i chapter 2 coding source programs user?s manual u10115ej3v0um 29 2.4.3 special characters the following special characters are single-byte characters. the equivalent double-byte characters cannot be used as special characters; they are interpreted as is. these special characters (except the lf code) can be used to represent their normal meanings in character strings (character constants) and in comment fields. single-byte character name main use space field delimiter ? question mark equivalent to an alphabetic character. @ unit price symbol specifies indirect addressing. _ underscore equivalent to an alphabetic character. , comma operand delimiter . period bit segment operator + plus plus sign or addition operator ? minus minus sign or subtraction operator * asterisk multiplication operator / slash division operator ( opening parenthesis ) closing parenthesis change operation order. $ dollar sign value of the location counter = equal sign comparison operator ; semicolon indicates the start of a comment. ;; double semicolon indicates the start of a comment in a macro. : colon label delimiter ' quotation mark indicates the start or end of a character constant. < > comparison operators # specifies immediate data. & ampersand specifies the concatenation of character strings in a macro. % expression operator used immediately before a macro parameter to indicate the transfer of a value. tab code horizontal tab equivalent to eight spaces. lf code line feed statement terminator cr code carriage return normally ignored by the assembler.
part i chapter 2 coding source programs 30 user?s manual u10115ej3v0um 2.5 symbol field when data or an address to be used in an instruction or pseudo instruction is written using a numeric value or numeric expression, AS6133 recognizes this as being an error. to use data or an address, use a name which enables its easy recognition. the name assigned to data or an address is called a symbol. a symbol can be entered in a symbol field. this is referred to as defining a symbol. a symbol to be used in a program can appear anywhere in the program provided that it is declared before use. the scope of a symbol depends on where it is declared. symbols having the same name cannot be used in a module. they can, however, be used in different modules because symbols are basically used locally within a module. to use a symbol globally in more than one module, the symbol must be declared as being public. symbols are classified as labels and names according to their purpose and how they are defined. (1) names the symbols defined in the equ and set pseudo instructions are called names. numeric data or addresses can be assigned to names. these names can be used in a program instead of numeric data and addresses. thus, numeric data can be used indirectly by assigning it a name. [example] data1 equ 8h the name data1 is defined for numeric data 8h. (2) labels labels are symbols which can be assigned to the address of an instruction (mnemonic) or to the org, dw, or dt pseudo instruction. a label is used to reference the program memory address (value of the location counter) assigned to the instruction or pseudo instruction to which the label is assigned. thus, a label can be written at the top address of a routine, with a name indicating the processing of the routine, thus causing a branch from another routine to the routine or to reference the routine. [example] loop:mov a,@r0h . . . jmp loop in this example, loop is a label.
part i chapter 2 coding source programs user?s manual u10115ej3v0um 31 2.5.1 rules governing the writing of symbols the following rules are applied to writing symbols: (1) symbols can use 8-bit jis codes and shift jis codes other than the single-byte special characters (except for the underscore and question mark). a symbol cannot begin with a single-byte digit. (2) a symbol can be between 1 and 253 characters in length (for single-byte characters). if a symbol exceeds 253 characters in length, an s error (syntax) error occurs. each shift jis code character consists of two bytes. (3) a label must be terminated with a single-byte colon (:) (3ah). (a single-byte space or tab code may be inserted between the label and the colon.) (4) when using the equ, set, or macro pseudo instruction, a name must be entered in the symbol field. the name must be terminated with a single-byte space or tab code. (5) a symbol cannot be defined more than once. otherwise, an s error (symbol duplication error) occurs. this does not apply to the symbols note defined in the set pseudo instruction or to those defined in macros that are not declared as being global. if not declared public, symbols having identical names can be used in different modules; the system regards them as being different symbols. (6) reserved words cannot be defined as symbols. it is possible to define symbols containing reserved words. (7) symbols are case-sensitive. [example 1] valid invalid fif4: 1f4f: ...............begins with a digit. label: label .............does not end with a colon (for a label). here: he re: .............a blank is embedded in the symbol. anh: anl: .................instructions cannot be used as symbols. endx: end: .................pseudo instructions cannot be used as symbols. [example 2] abc equ 3 xyz equ abc the same data "3" is assigned to both abc and xyz. note the value of the symbol defined in a set pseudo instruction can be changed. to change the value, use a set pseudo instruction.
part i chapter 2 coding source programs 32 user?s manual u10115ej3v0um 2.6 mnemonic field enter an instruction, pseudo instruction, or control instruction in the mnemonic field. for an instruction requiring an operand, a blank (one or more single-byte spaces or a tab code) is required to delimit the mnemonic field from the operand field. [example] valid invalid jmp loop jmploop .......... a blank is not inserted between the mnemonic and operand fields. ret re t ................ a blank is inserted in the mnemonic field. scaf sca .................. the sca instruction is not supported by the pd6133. 2.7 operand field in the operand field, enter the data (operand) necessary to execute the instruction. some instructions do not require operands while others require one or two operands. when two operands are required, delimit the operands with a comma ",". a blank is required between the mnemonic and operand fields. 2.7.1 operand field entry types (1) constant constants include numeric constants that consist of digits, or character constants that consist of characters. numeric constants include binary, octal, decimal and hexadecimal constants, all consisting of single-byte digits. (a) binary constant a single-byte character "b" must be added to the end of a binary string. (b) octal constant a single-byte "o" or "q" must be added to the end of an octal string. (c) decimal constant a single-byte "d" must be added to the end of a decimal string. the "d" can be omitted. (d) hexadecimal constant a single-byte "h" must be added to the end of a hexadecimal string. if a constant begins with a single- byte character other than 0 to 9, a "0" must be added to the beginning of the constant.
part i chapter 2 coding source programs user?s manual u10115ej3v0um 33 (e) character constant a character constant is a string of 8-bit jis character codes (except the lf code) and shift jis character codes, enclosed in single-byte quotation marks ('). with AS6133, character constants can be used in the title and include pseudo instructions only. as a result of assembly, the characters enclosed in single-byte quotation marks are converted to 8-bit jis or shift jis codes. to use a single-byte quotation mark in a character constant, it must be enclosed in quotation marks. no operations can be performed on character constants. [example] 'a' .................................. 41h (single byte) ' ' ................................. 8260h (double byte) '''' ............................... 27h (single byte) when two quotation marks are written, one single-byte quotation mark is reserved as a constant. 'a''' .............................. 4127h (single byte) ' ' .................................. 20h (single-byte space) '<' .................................. 203ch ' ' .................................. 93fah ' ' ....................... 93fa967b93648b43h (2) $ (location counter) "$" indicates the value of the location counter. in other words, it indicates the program memory address of the instruction for which the "$" is used. [example] address 101 mov a,r11 102 loop: inc a 103 jnc $-1 105 jmp $+20h the "$" in "jnc $ ? 1" indicates address 103h. consequently, $ ? 1 indicates address 102h. the $ in "jmp $+20h" indicates address 105h. "jnc $ ? 1" is equivalent to "jnc loop" where loop is a label.
part i chapter 2 coding source programs 34 user?s manual u10115ej3v0um (3) symbol when a symbol is entered in an operand field, the value assigned to the symbol (label or name) is assumed as the operand value. [example 1] a1: jc a2 : a2: anl a,r10 [example 2] value equ 1h mov a,#value "mov a,#value" is equivalent to "mov a,#1h". (4) expression an expression (character or numeric expression) consists of constants, $, and symbols that are combined with operators. there are seventeen operators (+, ? , *, /, mod, not, and, or, xor, shr, shl, eq or =, ne or <>, gt or >, ge or >=, lt or <, and le or <=). the priorities of these operators are predetermined. for details, see section 2.9 .
part i chapter 2 coding source programs user?s manual u10115ej3v0um 35 2.8 comment field a comment field begins with a single-byte semicolon (;), followed by the comment itself. comments assist the programmer in understanding the program when he or she refers to the assembly listing. while they are displayed on the assembly listing, the assembler ignores them. a comment can be written all 8-bit jis codes (except the lf code) and shift jis codes. when consecutive semicolons (;;) are used in a macro definition, the assembler handles the comment as a comment within the macro definition. it does not print the comment during macro expansion. a comment must be terminated with an lf code. if a comment is too long to fit on one line, start the next line with a semicolon (;).
part i chapter 2 coding source programs 36 user?s manual u10115ej3v0um 2.9 expressions and operators 2.9.1 expressions an expression (character or numeric expression) consists of constants, $, symbols, and operators in an operand field. 2.9.2 overview of operators (1) overview the operators of AS6133 assembly language are divided into five types. the priorities of these operators are predetermined. 1. arithmetic operators +, ? , *, /, and mod 2. logical operators or, and, xor, and not 3. comparison operators eq, ne, lt, le, gt, and ge (or =, <>, <, <=, >, and >=) 4. shift operators shr and shl 5. others ( and ) (operation order specifiers) & (replacement operator) (2) operator priorities the priorities of the operators are predetermined as listed in the table. enclosing an operator in ( and ) allows the order in which operations are performed to be changed. when multiple operators having the same priority exist in a single expression, they are executed in order, from left to right. in the table below, the highest priority is indicated by 1. table 2-1. operator priorities priority operators 1 ( ) (operation order specifiers) 2 *, /, mod, shl, shr 3+, ? 4 eq, ne, lt, le, gt, ge, =, <>, <, <=, >, >= 5not 6and 7or, xor
part i chapter 2 coding source programs user?s manual u10115ej3v0um 37 2.9.3 arithmetic operators (1) addition operator (+) adds operands together. [example] address symbol mnemonic operand 0010 start: jmp $+6 the jmp instruction causes a jump to address 16h. (2) subtraction operator ( ? ? ? ? ) subtracts one operand from another. [example] address symbol mnemonic operand 0020 back: jmp back ? ? ? ? 6 the jmp instruction causes a jump to address 1ah. (3) multiplication operator (*) multiplies operands. [example] address symbol mnemonic operand a6: mov a,#(2*3) the mov instruction causes 6 (2*3) to be loaded into acc. (4) division operator (/) divides one operand by another. the remainder, if any, is truncated. [example] address symbol mnemonic operand a5: mov a,#(256/50) the mov instruction causes 5 (256/50) to be loaded into acc. (5) mod operator finds the remainder resulting from an operand division. [example] address symbol mnemonic operand a5: mov a,#mod the mov instruction causes 6 (remainder of division 256/50) to be loaded into acc.
part i chapter 2 coding source programs 38 user?s manual u10115ej3v0um 2.9.4 logical operators (1) or operator finds the or of operands. [example] address symbol mnemonic operand mdfy1: mov a,#(0ah or 5h) the mov instruction causes 0fh to be loaded into acc. (2) and operator finds the and of operands. [example] address symbol mnemonic operand mask: mov a,#(1ah and 0fh) the mov instruction causes 0ah to be loaded into acc. (3) xor operator finds the exclusive or of operands. [example] address symbol mnemonic operand mdfy2: mov a,#(9ah xor 9dh) the mov instruction causes 7h to be loaded into acc. (4) not operator finds the 1's complement of the value of an operand. [example] address symbol mnemonic operand compl: mov a,#(not 3h and 0fh) the mov instruction causes 0ch (when not 3h; 0fffch, and 0fh) to be loaded into acc.
part i chapter 2 coding source programs user?s manual u10115ej3v0um 39 2.9.5 comparison operators (1) eq (equal) operator returns 0ffffh if the values on the right and left sides are equal; otherwise, returns 0. "eq" can be replaced by "=". [example] address symbol mnemonic operand comp1: mov a,#(one eq 1) the mov instruction causes 0fh to be loaded into acc if one is 1 and 0 if one is other than 1. (2) ne (not equal) operator returns 0ffffh if the value on the left side is not equal to that on the right side; otherwise, returns 0. "ne" can be replaced by "<>". [example] address symbol mnemonic operand comp2: mov a,#(one ne 1) the mov instruction causes 0fh to be loaded into acc if one is not 1; loads 0 if one is 1. (3) lt (less than) operator returns 0ffffh if the value on the left side is less than that on the right side; otherwise, returns 0. "lt" can be replaced by "<". [example] address symbol mnemonic operand comp3: mov a,#(mini lt 5) the mov instruction causes 0fh to be loaded into acc if mini is less than 5, or 0 if mini is equal to or greater than 5. (4) le (less than or equal) operator returns 0ffffh if the value on the left side is equal to or less than that on the right side; otherwise, returns 0. "le" can be replaced by "<=". [example] address symbol mnemonic operand comp4: mov a,#(mini le 5) the mov instruction causes 0fh to be loaded into acc if mini is equal to or less than 5, or 0 if mini is greater than 5.
part i chapter 2 coding source programs 40 user?s manual u10115ej3v0um (5) gt (greater than) operator returns 0ffffh if the value on the left side is greater than that on the right side; otherwise, returns 0. "gt" can be replaced by ">". [example] address symbol mnemonic operand comp5: mov a,#(max gt 5) the mov instruction causes 0fh to be loaded into acc if max is greater than 5, or 0 if max is equal to or less than 5. (6) ge (greater than or equal) operator returns 0ffffh if the value on the left side is equal to or greater than that on the right side; otherwise, returns 0. "ge" can be replaced by ">=". [example] address symbol mnemonic operand comp6: mov a,#(max ge 5) the mov instruction causes 0fh to be loaded into acc if max is equal to or greater than 5, or 0 if max is less than 5. 2.9.6 shift operators (1) shr (shift right) operator shifts the value on the left side to the right by the value on the right side. as a result of the shift, the msb is set to 0. [example] address symbol mnemonic operand 01fa field: mov a,#($ shr 5) $ (address: 01fah) is shifted to the right by five bits. as a result, 0dh is loaded into acc. (2) shl (shift left) operator shifts the value on the left side to the left by the value on the right side. as a result of the shift, the lsb is set to 0. [example] address symbol mnemonic operand 0021 fly: jmp fly shl 2 fly (address: 0021h) is shifted to the left by two bits. as a result, control jumps to address 0084h.
part i chapter 2 coding source programs user?s manual u10115ej3v0um 41 2.9.7 other operators (1) ( ) (operation order specifiers) indicate that the operation(s) enclosed within the parentheses should be performed first, irrespective of the operator priorities. the parentheses ( ) can be nested to up to 16 levels. [example] 5+8 ? 6*2/4 = 10 5+(8 ? 6)*2/4 = 6 (5+8 ? 6)*2/4 = 3 2*(0fh ? (0bh and (0ah or 0fh))) = 8 2*0fh ? 0bh and 0ah or 0fh = 0fh (2) & (replacement) operator used in a macro definition statement to concatenate the characters on the two sides of & during macro expansion. the & itself is replaced with a null code. [ example ] movi macro x mov a,#&x endm movi 1 mov a,#1
user?s manual u10115ej3v0um 42 chapter 3 pseudo instructions and control instructions 3.1 outline of pseudo instructions and control instructions the basic function of the assembler is to convert instructions into machine language. pseudo instructions and control instructions are provided to enhance the assembler's ease of use, as well as the readability of the output listings. pseudo instructions and control instructions are not converted to machine language. instead, they are used to direct the operation of the assembler. an exception to this, however, is the built-in macro pseudo instructions which are converted to machine language. 3.2 pseudo instructions AS6133 mnemonic field can contain a pseudo instruction. (1) location counter control pseudo instruction ? ? ? ? org (2) symbol definition pseudo instruction symbol definition pseudo instructions are used to define an arbitrary numeric, data memory address, flag, or label. ? ? ? ? equ ? ? ? ? set values assigned by symbol definition pseudo instructions cannot be changed. however, a symbol that has already been defined by a set pseudo instruction can be changed by using another set pseudo instruction. therefore, the set pseudo instruction is used to define a variable that is significant only at assembly time. (3) external definition and external reference pseudo instructions external definition and external reference pseudo instructions define and reference a symbol that is used by more than one module. ? ? ? ? public-below-endp (external definition pseudo instruction) ? ? ? ? extrn (external reference pseudo instruction) (4) data definition pseudo instruction data definition pseudo instructions are used to define data in a table area. ? ? ? ? dw: defines 8-bit data. ? ? ? ? dt: defines 10-bit timer table data.
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 43 (5) conditional assembly pseudo instruction the effective use of the conditional assembly pseudo instruction enables efficient programming and, furthermore, allows a library of source programs to be created. ? ? ? ? if-else-endif (6) repetitive pseudo instruction the effective use of the repetitive pseudo instruction enables efficient programming. ? ? ? ? rept-(exitr)-endr (7) macro definition pseudo instruction when a particular routine is used several times within a single program, a subroutine is usually used to save the number of program steps. when there are several similar processing routines having different parameters, such that a subroutine cannot be applied, a macro function is used to improve programming efficiency. the macro definition pseudo instruction is used to define such a macro. see section 3.5 for details. ? ? ? ? macro-endm (8) global declaration pseudo instruction for symbols in a macro ? ? ? ? global (9) assembly termination pseudo instruction the assembly termination pseudo instruction indicates the end of a source (program) module. ? ? ? ? end (10) mask option specification pseudo instruction ? ? ? ? option-endop
part i chapter 3 pseudo instructions and control instructions 44 user?s manual u10115ej3v0um 3.3 control instructions with AS6133, a mnemonic field can contain a control instruction. control instructions are not converted to machine language. instead, they control the output list format and source input after assembly. control instructions are valid only within the modules in which they are used. (1) output list control instructions output list control instructions are used to enhance the readability of the assembly listing. ? ? ? ? title: prints a title for the assembly listing. ? ? ? ? eject: invokes a page change. (2) source input control instruction when a program (source module) file becomes overly large, such that the programmer decides to divide the file, the source input control instruction can be used. the source input control instruction can also be used to enable the use of a previously created program (a program in a library). ? ? ? ? include a file can be referenced by using the include control instruction with the relevant file name specified.
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 45 3.4 pseudo instructions and control instructions this section explains each of the pseudo instructions and control instructions listed below. table 3-1. pseudo instructions and control instructions instruction name page org location counter control pseudo instruction p.46 equ p.47 set symbol definition pseudo instruction p.48 public-below-endp external definition pseudo instruction p.49 extrn external reference pseudo instruction p.51 dw p.52 dt data definition pseudo instruction p.53 if-else-endif conditional assembly pseudo instruction p.54 rept-(exitr)-endr repetitive pseudo instruction p.55, p.56 macro-endm macro definition pseudo instruction p.57 global global declaration pseudo instruction for symbols in a macro p.59 end assembly termination pseudo instruction p.60 option-endop p.61 usepoc/nousepoc p.62 pseudo instructions usecap/nousecap mask option specification pseudo instruction p.63 title p.64 eject output list control instructions p.65 control instructions include source input control instruction p.66
part i chapter 3 pseudo instructions and control instructions 46 user?s manual u10115ej3v0um org origin org symbol mnemonic operand comment [label:] org [;comment] [function] sets a value in the location counter. [usage] (1) the org pseudo instruction specifies the start address of program memory. code an org pseudo instruction at the beginning of each segment. (2) the org pseudo instruction specifies the start address of a table area. when this instruction is specified, any change made before the table area address has no effect on the table area address. [explanation] (1) before a symbol can be used as an expression in the operand field, that symbol must have been defined. (2) unless an address is specified with the org pseudo instruction at the beginning of a program, the assembler assigns address 0000 to the location counter. (3) if the address value specified with an org pseudo instruction is smaller than the previous location counter value, an a error (address specification error) occurs. if such an error occurs, the evaluation value coded in the operand is ignored, with the consecutive value next to the location counter value that existed immediately before the org instruction being assumed. (4) the previous location counter value is assigned to the label added to the org pseudo instruction. [example] 015d inc a 015e ret 0200 strt: org 200h 0200 mov a,#1 label strt is assigned 15fh. the operand of the org pseudo instruction is 200h, so the mov instruction is assigned to address 200h.
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 47 equ equate equ symbol mnemonic operand comment name equ [;comment] [function] assigns the value of the expression specified in the operand to the name coded in the symbol field. [usage] this instruction is used to define a data memory address. [explanation] (1) before a symbol can be coded in the operand field, the symbol must first be defined. (2) delimit the symbol field, mnemonic field, and operand field with a blank. (3) if the symbol or mnemonic field contains an error, the specified name is not registered. accordingly, a statement referencing that name becomes invalid. if the operand contains an error, 0 is assigned to the name. (4) for a name defined using the equ pseudo instruction, redefinition within the module in which the name is defined is not possible. if an attempt is made to redefine the name, an s error (duplicate symbol definition) occurs. (5) when a name is defined using the equ pseudo instruction, the name can be referenced by an instruction prior to the definition only when the name is specified in the operand of the instruction. (6) the defined expression value is not converted to pd6133 code; the value is assigned as is. [example] p3_init equ 12h p3_mod equ p3_init ; out p3,#p3_mod
part i chapter 3 pseudo instructions and control instructions 48 user?s manual u10115ej3v0um set set set symbol mnemonic operand comment name set [;comment] [function] assigns the value of the expression coded in the operand field to the name in the symbol field. in the operand field, memory name r 0 to r f , r 10 to r 1f , or r 00 to r 0f can be coded in addition to an expression. [usage] this instruction is used to set a formal parameter for a conditional assembly pseudo instruction (if-else-endif) or repetitive operation pseudo instructions (rept-endr, exitr). [explanation] (1) delimit the symbol field, mnemonic field, and operand field with a blank. (2) if the symbol or mnemonic field contains an error, the specified name is not registered. accordingly, any statement referencing that name becomes invalid. if an operand contains an error, 0 is assigned to the name. (3) for a name defined with a set pseudo instruction, a different value can be redefined. the value defined with a set pseudo instruction remains valid until the next set pseudo instruction is encountered. (4) when a name is defined using the set pseudo instruction, the name can be referenced by an instruction prior to the definition only when the name is specified in the operand of the instruction. (5) the defined expression value is not converted to pd6133 code; the value is assigned as is. [example] immed set 5 anl a,#immed ;immed=5 ; immed set 6 anl a,#immed ;immed=6
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 49 public public public below below below endp end public endp format 1 symbol mnemonic operand comment [label:] public [;comment] format 2 symbol mnemonic operand comment [label:] [name public equ endp below ] [;comment] [;comment] [function] the external definition pseudo instruction can be coded in either of two formats. format 1 is used to declare that symbols coded in the operand field are referenced by other modules. format 2 is used to declare that symbols defined in the block enclosed between public below and endp are referenced by other modules. [usage] the external definition pseudo instruction declares symbols as being referenced by other modules. [explanation] (1) an external definition pseudo instruction can be coded anywhere within a source program. (2) when format 1 is used, the symbols specified for public declaration in a module must be defined using a symbol definition pseudo instruction within the same module. if a symbol coded in the external definition pseudo instruction of format 1 is not defined in the same module, an s error (undefined symbol) occurs. (3) for format 2, if the block enclosed between public below and endp contains an instruction other than the symbol definition pseudo instructions, an s error (syntax error) occurs. (4) each statement is terminated by an lf code. if there are too many symbols to fit on one line, declare public again on the next line. (5) if the endp corresponding to public below is missing, a p error (no endp statement) occurs at the end pseudo instruction. (6) if a symbol declared as public is not referenced by any external module, a warning (unreference symbol) occurs at link time.
part i chapter 3 pseudo instructions and control instructions 50 user?s manual u10115ej3v0um public public public below below below endp end public endp [example] public val1,val2 . . . val1 equ 1 val2 equ 2 . . . public below val3 equ 3 val4 equ 4 endp
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 51 extrn extern extrn symbol mnemonic operand comment [label:] extrn [;comment] [function] declares that the symbols coded in the operand field (for which public declaration is performed in other modules) are referenced in the module. [usage] when symbols declared as public symbols in other modules are needed in a module, the extrn pseudo instruction can be used to enable the use of these symbols in the module. [explanation] (1) in a module, symbols declared with the extrn pseudo instruction cannot be referenced before extrn has been specified. (2) if a symbol for which extrn declaration is performed in a module is defined in the same module, an s error (symbol multi defined) occurs.
part i chapter 3 pseudo instructions and control instructions 52 user?s manual u10115ej3v0um dw define word dw symbol mnemonic operand comment [label:] dw [;comment] [function] sets an expression or characters coded in the operand field in the location indicated by the current location counter value (program memory address) as 8-bit object code. [usage] this instruction is used to define 8-bit data in a table area. [explanation] (1) a single expression that can be represented by eight bits can be coded for . if the value of the expression exceeds 10 bits, a v error (invalid value) occurs. if either bit 8 or 9 is 1, a warning message is generated. (in this case, bits 8 and 9 of the object code are set to 0.) if more than one expression is coded in the operand field, an o error (the number of operands is invalid) occurs. (2) if an undefined symbol is coded in the operand field, an s error (undefined symbol) occurs. (3) if the expression coded in the operand field is invalid, nop (e0e0h) is generated as the object code. caution the dw instruction is used to reference table areas other than the timer table area (mov t,@r0). to perform timer table area reference, use the dt instruction. [example] e. loc. obj. m i source statement e2e0 dw 20h e4e0 dw 340h ; <1> in <1> , a warning is generated, and a value for which bits 8 and 9 are 0 is set as the object code.
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 53 dt define timer dt symbol mnemonic operand comment [label:] dt [;comment] [function] sets the expression or characters coded in the operand field in the location indicated by the current location counter value (program memory address), as a 10-bit object code. [usage] this instruction is used to define timer data in a table area. [explanation] (1) a single expression that can be represented using 10 bits can be coded for . if the value of the expression exceeds 11 bits, a v error (invalid value) occurs. if more than one expression is coded in the operand field, an o error (invalid number of operands) occurs. (2) if an undefined symbol is coded in the operand field, an s error (undefined symbol) occurs. (3) if the expression coded in the operand field is invalid, nop (e0e0h) is generated as the object code. caution the dt instruction causes object code conversion to reference a timer table area (mov t,@r0). therefore, never use the dt instruction for an ordinary table reference instruction. (for ordinary table reference instructions, use the dw instruction.) [example] e. loc. obj. m i source statement ;** time data ** f8f7 dt 21fh ;carry on f1f7 dt 05fh ;carry off
part i chapter 3 pseudo instructions and control instructions 54 user?s manual u10115ej3v0um if if if else else else endif endif endif symbol mnemonic operand comment [label:] [statement [statement if [else] endif [;comment] ] [;comment] ] [;comment] [function] if the value of the operand field of the if statement is other than 0 (false), the statements enclosed between if and else are to be assembled. the statements between else and endif are not assembled. if the evaluation value of the operand field of the if statement is 0 (false), the statements enclosed between if and else are not assembled. the statements between else and endif are assembled, however. [usage] this instruction is used in an arbitrary routine in a program to select the statements to be expanded according to the use condition of the routine. [explanation] (1) all the statements between an if and the corresponding endif are defined as an if-endif block. (2) else is optional. it need not be specified. when else is specified, however, it can be used only once for an if-endif block. if else is specified more than once for a single if-endif block, an s error (syntax error) occurs for the second and subsequent elses. (3) before a symbol can be coded in the operand field of the if statement, the symbol must first be defined. (4) up to 40 levels of nesting, including macro reference statements and rept statements, are possible. (5) the else and endif statements cannot have any label. [example] if zzz0 eq 0 nop halt #3h else nop halt #zzz0 endif
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 55 rept repeat rept endr end repeat endr symbol mnemonic operand comment [label:] [statement [statement rept [exitr] endr [;comment] ] [;comment] ] [;comment] [function] expands the statement enclosed between rept and endr as many times as the value of . if exitr is encountered between rept and endr, expansion is terminated, and assembly is performed from the statement next to endr. [usage] this instruction is used to repeat the same statement. to disable the repetitive pseudo instruction temporarily or interrupt it during debugging, insert exitr. [explanation] (1) up to eight levels of nesting are possible. when macro reference statements and if statements are included, up to 40 levels are possible. (2) before a symbol can be coded in , the symbol must have already been defined. if the coded symbol is not defined or was defined on a previous page, an s error (undefined symbol) occurs. (3) a symbol in the operand of a pseudo instruction specified in the rept-endr block must have already been defined. if the symbol is defined after the appearance of the symbol, or if the symbol is not defined, an s error (undefined symbol) occurs. (4) if the endr corresponding to rept is missing, a p error (no endr statement) occurs for the end pseudo instruction which appears at the end of the module. [example] rept 3 ;repeat the dw 0 instruction three times. dw 0 endp
part i chapter 3 pseudo instructions and control instructions 56 user?s manual u10115ej3v0um exitr exit repeat exitr symbol mnemonic operand comment exitr [;comment] [function] exitr in the rept statement ends expansion, and performs assembly from the statement subsequent to endr. [explanation] (1) the exitr pseudo instruction can be used only between rept and endr. (2) if exitr is coded outside the rept-endr block, a p error (invalid exitr statement) occurs.
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 57 macro macro macro endm end macro endm symbol mnemonic operand comment name macro [statements (macro-body) endm [;comment] ] [function] assigns a macro name, indicated by name, to the sequence of statements (macro body) enclosed between macro and endm. the name is used as the definition name at macro reference time. [usage] this instruction is used for macro definition. [explanation] (1) macro body the macro body consists of symbols, instructions, pseudo instructions (except macro and endm), comments, and other macro statements including their macro bodies. (2) formal parameter group ? up to 32 formal parameters, delimited by a comma (,), can be coded, using up to 253 characters. ? formal parameters can be used only within a macro body. ? actual parameters are assigned to the formal parameters, coded in the macro body, when the macro is referenced. ? formal parameters can be coded in the symbol field, mnemonic field, and operand field. (3) when two semicolons (;;) appear successively in the macro body, the subsequent character string is treated as a comment in the macro. it is not expanded when the macro is referenced.
part i chapter 3 pseudo instructions and control instructions 58 user?s manual u10115ej3v0um macro macro macro endm end macro endm [example 1] macro having no parameter addr01 macro ;macro definition mov a,r01 inc a mov r01,a endm [example 2] macro having a parameter addrno macro rno ;macro definition mov a,rno inc a mov rno,a ;;rno+1 endm addrno r10 ;macro reference (expansion) mov a,r10 inc a mov r10,a [description] as shown in the above example, when a parameter is coded in the operand field of a macro, the parameter can be replaced by the parameter specified at the time of macro reference. a parameter in a macro definition statement is called a formal parameter. r10 is assigned to formal parameter rno. two successive semicolons (;;) are followed by a comment in the macro. this comment is not expanded at the time of reference.
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 59 global global global symbol mnemonic operand comment [label:] grobal [;comment] [function] declares symbols used in a macro as symbols that can be referenced outside the macro. [usage] before symbols used in a macro can be used outside that macro, the global pseudo instruction must first be specified. [explanation] (1) the global pseudo instruction can be used only inside a macro definition (within the block enclosed between macro and endm). if a global pseudo instruction is used outside a macro definition, an m error (invalid mnemonic) occurs. (2) the global declaration for a symbol must be coded before that symbol is defined. if the global declaration is performed after the symbol is defined, an s error (symbol multi defined) occurs. (3) when a symbol is declared as a global symbol in a source module program, the symbol can be used in the same source module program. (4) one or more symbol names can be specified in the operand field of the global pseudo instruction, provided they fit on one line (255 characters maximum). if the length of a statement exceeds 255 characters, an s error (syntax error) occurs, and the statement is ignored. [example] obj. m i source statement stmac macro ;macro definition global syma ;global declaration syma set 00h 0000 dw syma endm ; stmac ;macro reference ; 0000 dw syma ;a local symbol is referenced outside the macro. [description] when global declaration is performed for a symbol in a macro, the symbol value can be used as is upon the completion of macro expansion.
part i chapter 3 pseudo instructions and control instructions 60 user?s manual u10115ej3v0um end end end symbol mnemonic operand comment [label:] end [function] directs the assembler to terminate the source (program) module. [usage] code this instruction on the last line of a source (program) module. [explanation] (1) if the end pseudo instruction is not followed by the lf code (8-bit jis code: 0ah), an error occurs. when the screen editor is used for programming, modules can be cataloged even if the lf code is missing. therefore, be particularly careful not to forget the lf code. (2) if end is followed by a code other than the cr/lf code, such as a comment, a warning message is generated. such a statement is ignored. (3) if a source file does not end with an end statement, or if the end statement is not followed by a valid code, such as a cr code, preventing the assembler from recognizing the end pseudo instruction, a p error (end statement missing) occurs. if such an error occurs, the assembler generates an object file, assuming the end statement to be placed at the end of the file. [example] . . . . end [description] in the above example, the end pseudo instruction is placed in the last line of a source program module.
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 61 option option option endop endop endop symbol mnemonic operand comment [label:] option endop mask-option-pseudo-instruction [;comment] [function] the block enclosed between option and endop is called a mask option definition block. in the mask option definition block, a mask option pseudo instruction can be coded. the mask option pseudo instruction varies depending on the device. [explanation] (1) the option pseudo instruction must be terminated by the endop pseudo instruction. if an end pseudo instruction appears between the option and endop pseudo instructions, a p error (no option directive) occurs. (2) if an instruction that generates an object code is placed between the option and endop pseudo instructions, a warning is generated. in this case, the object code for the instruction between the option and endop pseudo instructions is not generated. (3) an option and endop pseudo instruction pair can be coded only once within a source program. if they are coded more than once, a p error (duplicated option directive) occurs for the second option pseudo instruction. at this time, the object code between option and endop is not generated. the option and endop pseudo instructions cannot be coded separately in two different modules. (4) if a source program for a device which requires a mask option contains no option pseudo instruction, an o error (not found mask option block) occurs at link time. [example] option ;include a low-voltage detection circuit. usepoc endop
part i chapter 3 pseudo instructions and control instructions 62 user?s manual u10115ej3v0um usepoc usepoc usepoc nousepoc nousepoc nousepoc symbol mnemonic operand comment usepoc nousepoc [;comment] [function] specifies whether a low-voltage detection circuit is used by mask option. usepoc specifies that the low-voltage detection circuit is used, and nousepoc specifies that the circuit is not used. [caution] an error occurs unless either usepoc or nousepoc is specified.
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 63 usecap usecap usecap nousecap nousecap nousecap symbol mnemonic operand comment usecap nousecap [;comment] [function] specifies whether a capacitor for oscillator is used by mask option. usecap specifies that the capacitor is used, and nousecap specifies that the capacitor is not used. [caution] an error occurs unless either usecap or nousecap is specified. this option can be specified with the products d67, d68, and d69.
part i chapter 3 pseudo instructions and control instructions 64 user?s manual u10115ej3v0um title title title symbol mnemonic operand comment [label:] title 'character-string' [;comment] [function] causes a page feed in the assembly listing, and outputs the character string specified in the operand field in the header line of the assembly listing. [usage] this instruction is used to print a title for the assembly listing and to enhance readability. [explanation] (1) up to 78 characters (8-bit jis code) can be coded as the character string. if the character string is longer than 78 characters, an i error (invalid data length) occurs. (2) when the title control instruction appears, the assembler performs a page feed, then prints the specified title (characters) as the header. when the title control instruction appears in the first line, however, the assembler does not perform a page feed. when a page feed is performed by the title control instruction, the title control instruction is output on the first line of a new page. (3) if a character string is not enclosed in quotation marks ('), an s error (syntax error) occurs. [example] source program listing . . . title 'subroutine' . . .
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 65 eject eject eject symbol mnemonic operand comment [label:] eject [;comment] [function] causes a page feed in the assembly listing. [usage] this instruction is used to change the page at the beginning of a new routine. when a page feed is performed, the readability of the assembly listing is enhanced. [explanation] (1) when an eject control instruction appears, the assembler performs a page feed. (2) when a page feed is performed by the eject control statement, the eject control statement is printed on the page before the page feed. [example] source program listing . . jmp abc eject def: . .
part i chapter 3 pseudo instructions and control instructions 66 user?s manual u10115ej3v0um include include include symbol mnemonic operand comment [label:] include 'file-name' [;comment] (for details of the file naming conventions, see "preface.") [function] reads a source program specified by file name, and processes it as part of the source program. [usage] this instruction is used to include another split file. [explanation] (1) a source module specified by include can contain another include statement. up to eight levels of include nesting is possible. if the nesting is performed to more than eight levels, a nest overflow error occurs. (2) the file specified by the include control statement must end with the eof statement. if eof is not specified, a warning is generated. (3) if no extension is specified for the file name, the extension is assumed to be asm. (4) the file connected by the include control instruction is not a split module. therefore, the symbols in the original source program can be referenced as is. (5) if a file name is not enclosed in quotation marks ('), an s error (syntax error) occurs, and this specification is ignored. (6) a path name can be used as the file name. (up to 64 characters can be coded as a file name.) (7) if the file specified by file name does not exist, an f error (the include file cannot be opened) occurs.
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 67 include include include [example 1] source program . . . include 'sub1.asm' . . . include 'sub2.asm' . . . end sub1.asm . . . . sub2.asm . . . .
part i chapter 3 pseudo instructions and control instructions 68 user?s manual u10115ej3v0um include include include [example 2] source module a include 'macrofile.asm' . . . end source module b include 'macrofile.asm' . . . end up to 16 include files can be coded in one source module. the total length of the include file names coded in one source module must not exceed 255 characters. caution when the /host option is specified, a source file name can contain neither the drive name nor directory name. macrofile.asm mac1 macro a1,a2 . . . endm mac2 macro b1,b2 . . . endm . . . [description] only macros that are used in multiple modules are placed in one file. then, the file is included by using the include control statement. the macros can be shared by source modules without having to use the public and extrn pseudo instructions. when the public and extrn pseudo instructions are used, however, the names of the macros used must be declared in each module.
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 69 3.5 macro function when a particular routine is used several times within a single program, a subroutine is generally used to save the number of program steps. when similar processing routines but with different parameters exist, and a subroutine cannot be applied, a macro function is used to enable efficient programming. 3.5.1 macro definition and applicable range (1) macro definition to define a macro, use the macro definition pseudo instruction (macro, endm). when a macro is defined, formal parameters can be used. see table 3-1 for details of the macro definition pseudo instruction. (2) applicable range of macros two types of symbols are defined in a macro: local symbols that can be used only within the macro, and global symbols that can be used both in the macro and in other routines. to use symbols as global symbols, perform global declaration in the macro by using the global pseudo instruction. symbols that are not declared as global symbols are handled as local symbols and can be used only within the macro. see table 3-1 for details of the global pseudo instruction. when a macro is used, program readability can be improved by assigning an easily remembered name to a sequence of blocks that represents the procedure performed by those blocks. in addition, the macro can be used in much the same way as a library. to do this, create a separate file containing macro definition statements only. then, specify the include statement at the beginning of a source program to read the contents of the file. ? ? ? ? local symbols symbols defined in a macro are assumed to be local symbols unless declared otherwise. local symbols can be used only within the macro in which they are defined. in this case, macro reference statements in the macro and include statement in the macro are also included. therefore, even when the same symbol name as that of a local symbol in a macro is defined outside the macro, or when a particular macro is referenced more than once, such that similar statements are generated, the assembler does not regard them as a duplicate definition. ? ? ? ? global symbols a symbol defined in a macro sometimes needs to be referenced from outside of that macro. to do this, the symbol must be declared as a global symbol to enable the symbol to be referenced from any statement in the module in which the symbol is used. (see table 3-1 for an explanation of the global declaration method and an example of its use.) note, however, that when a symbol defined by other than the set pseudo instruction references a macro declared as being global in a fixed manner more than once, such that a sequence of statements is generated, a duplicate definition error occurs for that symbol. if a value is defined for a symbol with the set pseudo instruction outside a macro, and the same symbol is set inside the macro, the symbol is treated as a local symbol in the macro. then, that symbol has no relationship with the symbol having the same name but which is outside the macro. when the symbol outside the macro needs to be assigned a value in the macro, global declaration is required.
part i chapter 3 pseudo instructions and control instructions 70 user?s manual u10115ej3v0um (3) using a macro the use of a macro requires that definition and reference be performed. assigning a macro name to a sequence of instructions and pseudo instructions is referred to as macro definition. [example 1] addr01 macro ;macro definition mov a,r01 inc a mov r01,a endm in the above example, macro name addr01 is assigned to the following three instructions: mov a,r01 inc a mo r01,a an arbitrary macro name can be specified. however, the specified macro name must be neither an existing symbol name nor a reserved word. when a macro is defined in a module, it can be used from that module any number of times after being defined. specifying a macro name to use the contents of the macro definition is referred to as macro reference. code a macro reference statement in the mnemonic field. when a macro is referenced, the assembler expands the instructions and pseudo instructions assigned to the macro in the order in which they are defined. this is referred to as macro expansion. [example 2] addr01 ;macro reference (expansion) mov a,r01 inc a mov r01,a the following lists the macro-related pseudo instructions: macro-endm global rept-exitr-endr
part i chapter 3 pseudo instructions and control instructions user?s manual u10115ej3v0um 71 3.5.2 macro reference [function] a macro body defined with the macro and endm statements is referenced. [format] symbol mnemonic operand comment [label:] name [;comment] [explanation] (1) as the name, specify the macro name coded in the symbol field of the macro statement. the name must be defined before it can be referenced. (2) the following five forms can be coded as actual parameters. they are evaluated as 16-bit data. (a) expression (b) character constant (8-bit jis code or shifted 8 jis code string, enclosed in quotation marks) (c) space or blank (no coding, comma only) (d) symbol (e) constant (3) formal parameters are replaced by actual parameters on a one-to-one basis in the order in which they are coded, starting from the left. if the number of actual parameters exceeds the number of formal parameters, an o error (operand count error) occurs. if the number of actual parameters is smaller than the number of formal parameters, a null code is assigned to the remaining formal parameters for which no corresponding actual parameters exist. in this case, no error occurs at macro reference time. however, an error caused by the null code may occur at macro expansion. (4) when a blank, comma, quotation mark, semicolon, or tab is coded as an actual parameter, it must be enclosed in quotation marks so that it can be handled as a character string. (5) a macro body can contain macro reference statements. up to 40 levels of nesting, including repetitive pseudo instructions, macro reference statements, and if statements, is possible. if the nesting depth exceeds 40 levels, an n error (nesting overflow) occurs, and the illegal nesting is not assembled. alternatively, an m error (macro area overflow) occurs, and the macro is not expanded. [example] admac 2,5 admac is a macro name defined with a macro definition pseudo instruction, and 2 and 5 are actual parameters required when admac is referenced.
part i chapter 3 pseudo instructions and control instructions 72 user?s manual u10115ej3v0um 3.5.3 macro expansion the assembly of source programs using macros consists of the following steps: <1> when a macro definition is encountered, the macro body is stored in an internal memory area of the assembler as is (macro registration). <2> when a macro reference is found, the symbol table is searched for the corresponding macro body, after which the macro body is inserted in the macro name position. <3> the expanded program is assembled. when two successive semicolons (;;) appear in a macro body, the portion between ;; and the end of that line is regarded as a comment, such that that portion is not expanded at macro reference. [explanation] (1) macro expansion is performed in path 1 of the module assembly phase. (2) before a symbol defined outside a macro can be referenced by the operand of a pseudo instruction coded in the macro, the symbol must be defined prior to the macro reference. if the symbol is not defined or is defined after the macro reference, an s error (symbol undefined) occurs. [example] htimer macro timeval,haltval mov t,#timeval halt #haltval endm htimer 100h,0101b <1>: a macro named htimer is defined. timeval and haltval are formal parameters. <2>: a macro named htimer is referenced. 100h and 0101b are actual parameters. they correspond to formal parameters timeval and haltval, respectively. as a result of the reference to htimer, expansion is performed as follows: mov t,#100h halt #0101b <1> <2>
user?s manual u10115ej3v0um 73 part ii operation
user?s manual u10115ej3v0um 74 chapter 1 product overview 1.1 product description program name file name file type assembler AS6133.exe command file the command file is the first file to be read into memory when program execution begins. 1.2 supported debugger use the following debugger when using the AS6133 assembler. nec?s sm6133 v1.02 and v1.06 cannot be used. manufacturer: naito densei machida mfg. product name: eb-6133 emulator 1.3 system configuration this section describes the operating environment necessary to run AS6133. (1) host machine see "preface" for the personal computers on which this assembler can run. (2) operating system see "preface" for the operating systems on which this assembler can run. (3) user memory size 512 kb or larger (4) files necessary to run AS6133 1. source file ( .asm) this is a file of a source program to be assembled. 2. sequence file ( .seq) this is a file of information necessary to specify a device file name, assembly options, and a source file name at the start of the assembler. when more than one source module file is to be assembled, it is necessary to specify the source file names in the sequence file beforehand. 3. ms-dos environment file (config.sys) setting: files = 15 (15 or more) buffers = 10 (10 or more)
user?s manual u10115ej3v0um 75 chapter 2 before execution 2.1 creating a backup file before using AS6133, create its backup copy by copying the contents of the original assembler disk to a work disk. this is to prepare for disruption of the contents of the floppy disk or the disk itself. keep the original disk in a safe place. procedure to create a backup file 1. start ms-dos. 2. insert the ms-dos system disk into drive a, and a new floppy disk into drive b. 3. format the new floppy disk in drive b using the format command and copy the system to it. a>format b:/s ? a> 4. remove the ms-dos system disk from drive a, and insert the AS6133 original disk into drive a. enter the copy command to transfer AS6133.exe from the disk in drive a to the disk in drive b. a>copy a:*.* b:/v ? a> 5. all the contents of the disk in drive a have been transferred to the disk in drive b. a>dir b:/w ? AS6133.exe a> 2.2 install (1) copy the file (AS6133.exe) in the supplied medium to the install destination. for example, if the supplied medium is set in floppy disk drive a: and the install destination is c:\nectools\bin, execute the copy command as follows: x> copy a:*.* c:\nectools\bin (2) add the directory at the install destination to environmental variable path. in the above example, add the following line to autoexec.bat. path c:\nectools\bin;%path%
user?s manual u10115ej3v0um 76 chapter 3 sequence file 3.1 overview when starting the assembler and assembling a program, it is necessary to specify the target device file, source module file, and assembly options. note (this information is generically called an assembly condition.) the assembly condition is specified in a sequence file. using a sequence file makes it possible to specify many assembly conditions under one sequence file name. during debugging, source module files can be deleted or added simply by changing the contents of the sequence file. effective use of a sequence file can make debugging efficient, as described above. note an assembly option specifies, for example, whether to output an assembly listing. see section 4.5 for details. 3.2 sequence file format the sequence file is created using an editor or the copy command. the file extension of the sequence file must always be ".seq". 3.2.1 overall format [;comment] device-name [;comment] ; <1> /option[/option/option/.../.../......] [;comment] ; <2> source-file-name [;comment] .. .. <3> .. source-file-name [;comment] [description] (1) specify a device name at <1> . (2) specify assembly options at <2> . only one assembly option can be placed between two adjacent slashes (/). to specify more than one assembly option, write them in succession and separate them with a slash. if two or more lines are used to specify assembly options, each line must begin with a slash. assembly options specified at <2> are effective when any source file is assembled. (3) specify a source module file at <3> . (4) in the sequence file, begin a comment with a semicolon (;) in the same way as in the source program. a comment can be placed anywhere in the sequence file. (5) the device name, assembly options, and source file name must be specified in the stated order. otherwise, an error is detected.
part ii chapter 3 sequence file user?s manual u10115ej3v0um 77 3.2.2 device name format [;comment] device-name [;comment] [function] the device name of the product that is the target of assembly is specified. [description] (1) usually, the sequence file should begin with a device name. however, a comment can precede the device name. (2) no file extension is used. if an unspecified device name is used, the following error is detected during assembly, and assembly is aborted. not found device statement if a device name is written in a place where it should not be, an error will be detected during assembly. (3) table 3-1 shows the correspondence between device names that can be described in the sequence file and devices. table 3-1. device name that can be described and supported device device name supported device d6133 pd6133 d6134 pd6134 d6135 pd6135 d6604 pd6604 d6605 pd6605 d63 pd63 d63a pd63a d64 pd64 d64a pd64a d62 pd62 d62a pd62a d65 pd65 d6132 pd6132 d6132a pd6132 d67 pd67 d68 pd68 d69 pd69 caution use the device name of the corresponding rom version device when using the pd61p34b, 66p04b, 6p4b, 6p5, or 6p9.
part ii chapter 3 sequence file 78 user?s manual u10115ej3v0um [example] when the pd6133 is the target product d6133 ; pd6133 note leave out " p" from the product name. 3.2.3 assembly option format [/option] [/option] [/......] [/option] [/option] [/......] [/option] [;comment] [function] assembly options are specified. [description] (1) usually, the specification of assembly options should begin on a line immediately after the device name file. however, a comment can precede the specification of assembly options. (2) each assembly option must be prefixed with a slash (/). (3) to specify more than one assembly option, separate them with a slash. one or more space characters are allowed between two assembly options. (4) assembly options may be written over more than one line. each line must end with a pair of cr/lf characters, and each continuation line must begin with a slash. (5) if mutually exclusive assembly options are specified, the last one to appear is effective. (6) assembly options can be omitted. (7) see section 4.5 for details of assembly options. if an assembly option is specified in a place where it should not be, an error is detected during assembly. 3.2.4 source file name format source-file-name [;comment] source-file-name [;comment] : source-file-name [;comment] [function] the name of a source file to be assembled is specified. [description] more than one source file name cannot be specified on one line. caution if the /host option is specified, neither a drive name nor a directory name can be specified in a source file name.
part ii chapter 3 sequence file user?s manual u10115ej3v0um 79 3.3 example of a sequence file description an example of describing a sequence file (sample.seq) is given below. ;device name d6134 ; <1> ;option /host <2> /work=b: ;source module init.asm main.asm sub1.asm <3> sub2.asm data.tbl [description] <1> is the name of a device that is the target of assembly. <2> is the specification of assembly options. <3> is a source module to be assembled. a sequence file can be created using either an editor running on ms-dos or the copy command (ms-dos system command). the copy command may be sufficient if the sequence file to be created is small. however, if it is necessary to correct a sequence file or create a large sequence file, an editor will be more convenient. caution if the /host option is specified, neither a drive name nor a directory name can be specified in a source file name.
user?s manual u10115ej3v0um 80 chapter 4 assembler functions 4.1 overview AS6133 reads a specified source module file and creates files such as an object file and assembly list file from the statements in the source module file. AS6133 uses a two-pass assembly method. in the first pass, a symbol table is created, and mnemonics are converted to machine words. symbols are left undefined, but an area is reserved for them. in the second pass, the symbol area reserved in the first pass is allocated to the machine words. after the second pass ends, an intermediate object module file is created. when the intermediate object module file is created, address information about branches extending over more than one module file has not been resolved. next, AS6133 links the intermediate object module files to create an object file. this linkage processing is started automatically. AS6133 has an assembly time reduction function to make assembly efficient. when an intermediate object module file is created at the end of the second pass, the date/time of creation is added to the intermediate object module file. when a source module file is partly corrected and reassembled, the creation date/time of the source module file is compared with that of the existing intermediate object module file that has the same file name as that source module file. the source module file is assembled only when its creation date/time is more recent than that of the intermediate object module file. if the creation date/time of an object module file is more recent than that of the corresponding source module file, AS6133 assumes that the source module file has not been changed and need not be reassembled. in this case, the existing object module file is used in linkage editing.
part ii chapter 4 assembler functions user?s manual u10115ej3v0um 81 4.2 assembly input/output files AS6133 uses the following input files. input file name description file type source file source file created using an editor .asm sequence file file in which a device name, the specification of assembly options, and a source module file are saved. * use of a sequence file eliminates the necessity to specify a device name, assembly options, or a source module file each time the assembler is started, thus making assembly efficient. .seq remark an underlined file extension can be changed. AS6133 uses the following output files. output file name description file type prom file file holding object code in intel hex format, and ifl/dfl. ifl/dfl is followed by an end code in intel hex format. the object code and ifl/dfl are written at one time by downloading the pro file to the prom writer. .pro assembly list file file holding the assembly list of a source module file. .prn cross-reference list file file holding the cross-reference list of a source module file. if no list is output, the file extension is .xrf. .prn log file file holding error and warning messages to be output to the console during assembly. the name of this file is fixed at "AS6133.log." .log intermediate object module file intermediate file created for each source file during assembly during linkage, the intermediate object module file is used as an input file. .obj remark an underlined file extension can be changed.
part ii chapter 4 assembler functions 82 user?s manual u10115ej3v0um 4.3 assembler functions 4.3.1 intermediate object module file output function a source module file (.asm) specified at the start of assembly is converted to machine words, which are then output to an intermediate object module file (.obj) having the same name as the source module file. the intermediate object module file is added with the date/time it was created. 4.3.2 linkage function AS6133 is an absolute assembler, but it has a linkage function so that a source file split into modules can be assembled. when source module files are assembled, an intermediate object module file is created for each source module file, and linkage is automatically carried out later by accepting the intermediate object module files as input. 4.3.3 pro file output function a pro file is created by linking intermediate object module files. the pro file consists of the object part and ifl/dfl part. it is a prom data file for ordering a masked rom chip. see chapter 5 for details. 4.3.4 assembly time reduction function AS6133 has an assembly time reduction function to make debugging efficient. before a source module file is assembled, its creation date/time is compared with the creation date/time of an intermediate object module file having the same name as the source module file (if there is one). if the creation date/time of the intermediate object module file is more recent than that of the source module file, AS6133 assumes that the source module file has not been changed and need not be reassembled. if the creation date/time of the intermediate object module file is earlier than that of the source module file having the same file name, that source module file and all source module files specified after that source module file are assembled unconditionally. if the order in which source module files are specified is changed, or a source module file is added or deleted, a source module file changed after the latest assembly, and all source module files that follow it will be assembled unconditionally. to make the most of the assembly time reduction function, place debugged source module files before those which are currently being debugged.
part ii chapter 4 assembler functions user?s manual u10115ej3v0um 83 figure 4-1. processing flow of the assembly time reduction function (1/2) start of AS6133 read a sequence file. generate an object file name from the source file name. no yes other than AS6133 AS6133 no yes yes no yes no yes no no yes were all source files assembled? yes no go to <1> on the next page. is there any object file having the same name as the source file? what assembler was used to create the object file? note 1 are the same device name and options specified? note 2 was the source file created more recently than the object file? to the next module was the include file specified in the source file created more recently than the object file? note 3 was the order in which the source file was specified changed? note 4 is the device same? note 5 skip the assembling of the source file. assemble all source files described after that source file in the sequence file. assemble the source file and create an object file.
part ii chapter 4 assembler functions 84 user ? s manual u10115ej3v0um figure 4-1. processing flow of the assembly time reduction function (2/2) no yes end of AS6133 was the pro file created at the same time or after any object file? linkage editing <1> notes 1. the object file created using AS6133 begins with the "as61" string. 2. the device name and options specified in the sequence file are checked with those specified in the object file. 3. the name of the include file is acquired from the object file. 4. the name of the immediately preceding source file is acquired from the object file. 5. the device information is acquired from the object file. 4.3.5 assembly list file output function an assembly list file can be output after assembly. an assembly option controls whether to output an assembly list file. see chapter 5 for details.
part ii chapter 4 assembler functions user ? s manual u10115ej3v0um 85 4.3.6 cross-reference list file output function AS6133 creates a cross-reference list file. see chapter 5 for details. figure 4-2. AS6133 input/output file configuration sequence file (.seq) temporary file note the device name, assembly option, and source module file are specified. source module file (.asm) host machine pro file (.pro) intermediate object module file (.obj) assembly list file (.prn) cross-reference file (.xrf) log file (AS6133.log) AS6133 note the temporary file will be deleted at the end of assembly.
part ii chapter 4 assembler functions 86 user ? s manual u10115ej3v0um 4.4 assembler start-up procedure 4.4.1 input files needed when the assembler starts the following files are necessary to start the assembler. (1) sequence file (.seq) this file holds a device name, assembly options, and a source program file name that are required during assembly. (2) source module file (.asm) this file contains a source program. see section 4.2 for details. 4.4.2 starting the assembler this section describes the actual procedure to start the assembler. the assembler can be started by either of the following procedures. input methods (1) >[directory]AS6133 ? (2) >[ directory ]AS6133 ? ? : current drive name cautions 1. to omit [directory] of AS6133, it is necessary to specify the path environment variable. 2. the sequence file and source file must be in the same directory. the operation of the assembler is described below for the above two input methods separately. (1) starting by >[directory]AS6133 ? ? ? ? insert the assembler disk into drive a, and the disk holding the sequence and source files in drive b. change the prompt to drive b, where the disk holding the sequence and source files is inserted, and enter as follows: "a:AS6133" b>a:AS6133 ? the assembler will be loaded into memory and started to run. after started, the assembler searches the current directory for the sequence file (.seq) as follows: 1. if there is one sequence file in the current directory the sequence file is read automatically, and assembly is carried out according to the contents of the sequence file. 2. if there is more than one sequence file in the current directory all sequence file names are numbered sequentially starting at 1, and listed on the display screen. the user should select the sequence file to be subjected to assembly. 3. if there is no sequence file to be selected the assembler stops running. re-set the entry.
part ii chapter 4 assembler functions user?s manual u10115ej3v0um 87 [example] (a) starting the assembler under ms-dos b>a:AS6133 ? pd6133 series assembler vx.xx [xx xxx xx] copyright (c) nec corporation 1995, 2000 === seq file list in current directory === 1) test1.seq 2) test.seq 3) test2.seq 4) test3.seq enter the sequence file number: 2 ? test.asm assembly started on: hh:mm:ss mm/dd/yy (b) starting the assembler under pc dos b>a:AS6133 ? pd6133 series assembler vx.xx [xx xxx xx] copyright (c) nec corporation 1995, 2000 === seq file list in current directory === 1) test1.seq 2) test.seq 3) test2.seq 4) test3.seq seq file ? (select number) = 2 ? test.asm << assembly start >> hh:mm:ss mm/dd/yy (2) starting the assembler by >[directory]AS6133 ? ? ? ? ? insert the assembler disk into drive a, and the sequence and source file disk into drive b. enter "AS6133 ? b:sample.seq" in response to the prompt (a>). a>AS6133 ? b:sample.seq ? this entry causes the assembler to be loaded into memory and to run according to the sample.seq sequence file in drive b. the ".seq" extension can be left out from the sequence file name. if it is left out, it is assigned automatically. if the specified sequence file is missing, the assembler ends running. enter the correct sequence file name. 4.4.3 aborting assembly to abort the assembler, enter control+c (^c) from the console. on receiving ^c, the assembler closes all files and stops running. after the assembler stops, the ms-dos prompt (a>) appears.
part ii chapter 4 assembler functions 88 user ? s manual u10115ej3v0um 4.5 assembly options assembly options are used to specify the files to be output during assembly, their types, related variables, and work drive. assembly options are specified when they are written in the sequence file. see section 4.4 for details. if no assembly option is specified, the default assembly options (previously specified in the assembler) are used. table 4-1. assembly options option default note description reference hos[t] noh[ost] host controls eb-6133 emulator output. p.89 obj[=] noo[bj] obj (disabled) controls object output. p.90 pro[=file-name[.pro]] nopro pro (disabled) controls load module output. p.91 lis[t][=file-name[.prn]] nol[ist] list (disabled) controls assembly list output. p.92 xref[=file-name[.xrf]] nox[ref] xref (nox) controls cross-reference list output. p.93 row[=n] row = 66 (enabled) specifies the number of lines to be output on one page of list output (50 to 250). p.94 col[umn][=n] col = 80 (col = 132) specifies the number of columns to be output on one line of list output (72 to 256). p.94 seq nos[eq] seq (nos) controls option information output. p.95 tab not[ab][=n] notab = 8 (enabled) controls tabs (1 to 255). p.95 for[m] nof[orm] form (enabled) controls form feed. p.96 zzzn = m zzzn = 0 (enabled) controls assembly variables. p.96 wor[k] = drive-name: current drive (enabled) specifies a work drive. p.97 head nohead head (head) controls list header output. p.97 hel[p] ? displays help messages. p.98 note information enclosed in parentheses corresponds to the setting used when /host is specified. "disabled" means that the default value is fixed. only the currently "enabled" value can be used. caution to use the eb-6133 emulator, it is always necessary to specify the host option.
part ii chapter 4 assembler functions user?s manual u10115ej3v0um 89 4.5.1 option to control eb-6133 emulator information output [format] hos[t] default value.../host noh[ost] [function] this option specifies whether to output information necessary to use the eb-6133 emulator ( pd6133 series development tool). [description] (1) hos[t] the information about the eb-6133 emulator is output to the object file. the following assembly options are specified forcibly: /obj/pro/list/noxref/col = 132/noseq all the files related to the above assembly options are output to the directory where the sequence file is. caution when /host is selected, all related input files (source files) must be in the same directory as the sequence file. (2) noh[ost] the information about the eb-6133 emulator is not output. caution if no option is specified, /host is specified as default assumption.
part ii chapter 4 assembler functions 90 user ? s manual u10115ej3v0um 4.5.2 option to control object file output [format] obj[=] default value.../obj noo[bj] when /host is specified...disabled [function] this option specifies whether to output an intermediate object file. if the option specifies to output an intermediate object file, it also specifies the directory to which the file is to be output. if the specified directory contains an intermediate object file having the same name as the source module file, and its creation date/time is more recent than the source module file, assembly will not be carried out. [description] (1) /obj[=] an intermediate object file will be output. (2) /noo[bj] no intermediate object file will be output. (3) the option can specify only the directory to which an intermediate object file is to be output. it cannot specify the name of the intermediate object file. (4) if no intermediate object file is to be output (/noo is specified), the /pro option is disabled. (5) this option is disabled, if the /host option (eb-6133 emulator information output) is specified. in this case, the intermediate object file is always output to the directory where the sequence file is.
part ii chapter 4 assembler functions user?s manual u10115ej3v0um 91 4.5.3 option to control load module file (pro file) output [format] pro[=file-name[.pro]] default value.../pro nop[ro] when /host is specified...disabled [function] this option specifies whether to output a load module file (pro file). if the option specifies to output a load module file, it also specifies the name of the load module file. [description] (1) pro[=file-name] a pro file is output. ? ? ? ? specifying no file name a load module file is output to the directory where the sequence file is, and named after the sequence file, that is: sequence-file-name.pro ? ? ? ? specifying a file name a load module file is created under the specified file name. the file names that can be used include: aux, con, prn, and nul. these files are directed to the following devices. ? aux: rs-232c ? con: console (usually crt) ? prn: printer ? nul: no file output the file name must be specified in format: [drive-name:[\directory\]]file-name if a file extension is omitted, ".pro" is used. (2) nop[ro] no load module file is output. (3) this option is disabled, if the /host option (eb-6133 emulator information output) is specified. in this case, the pro file is always output to the directory where the sequence file is.
part ii chapter 4 assembler functions 92 user?s manual u10115ej3v0um 4.5.4 option to control assembly list file output [format] lis[t][=file-name[.prn]] default value.../list nol[ist] when /host is specified...disabled [function] this option specifies whether to output an assembly list file. if the option specifies to output an assembly list file, it also specifies the name of the assembly list file. [description] (1) lis[t] an assembly list file is output. the destination of output can be specified in either of the following two ways. specifying no file name an assembly list file is created under the same name as the source file in the directory where the source file is. if a source program is split into several modules, an assembly list file corresponding to a specific source module file is created under the same name as that source module file in the directory where that source module file is. the file extension ".prn" is used for the assembly list file. specifying a file name an assembly list file is created under the specified file name. the file names that can be used include: aux, con, prn, and nul the file name must be specified in format: [drive-name:[\directory\]]file-name if a file extension is omitted, ".prn" is used. (2) nol[ist] no assembly list file is output. (3) this option is disabled, if the /host option (eb-6133 emulator information output) is specified. in this case, the assembly list file is always output under the same name as the source file to the directory where the sequence file is. the file extension ".prn" is used.
part ii chapter 4 assembler functions user ? s manual u10115ej3v0um 93 4.5.5 option to control cross-reference list file output [format] xre[f][=file-name[.xrf]] default value...xref nox[ref] when /host is specified.../nox [function] this option specifies whether to output a cross-reference file. if the option specifies to output a cross-reference file, it also specifies the name of the cross-reference file. if the output of a cross-reference file is specified, a cross-reference file is output for each source module file on a one-to-one basis. [description] (1) xre[f] a cross-reference file is output. the destination of output can be specified in either of the following two ways. specifying no file name <1> if an assembly list is output, the cross-reference list is output to the same file as the assembly list. in this case, the file name specified here must be the same as the assembly list file. <2> if no assembly list is output, that is if nol is specified, a cross-reference file is created under the same name as the source file in the directory where the source file is. in this case, the file extension ".xrf" is used for the cross-reference file. specifying a file name a cross-reference file is created under the specified file name. this method is used to specify that the cross-reference list be output to a file different from the assembly list file. the file names that can be used include: aux, con, prn, and nul the file name must be specified in format: [drive-name:[\directory\]]file-name if a file extension is omitted, ".xrf" is used. (2) nox[ref] no cross-reference file is output.
part ii chapter 4 assembler functions 94 user ? s manual u10115ej3v0um 4.5.6 option to control the number of lines to be output on one list output page (row no.) [format] row=n default value.../row = 66 when /host is specified...enabled [function] this option specifies the number of lines per page in all list files (such as assembly list and cross-reference list files). [description] "n" is the number of lines per page. it is a decimal number, and can range between 50 and 250 (inclusive). 4.5.7 option to control the number of columns to be output on one list output line [format] col[umn]=n default value.../col = 80 when /host is specified.../col = 132 [function] this option specifies the number of columns per line in all list files (such as assembly list, memory map, and cross- reference list files). [description] "n" is the number of lines per page. it is a decimal number, and can range between 72 and 255 (inclusive).
part ii chapter 4 assembler functions user ? s manual u10115ej3v0um 95 4.5.8 option to control option information output [format] seq default value.../seq nos[eq] when /host is specified.../nos [function] this option specifies whether to output the following information to the first page of the assembly list of each source module. ? sequence file name specified when the assembler is started, and the contents of the sequence file (seq=) [description] (1) seq information (described under [function]) about the options is output to the first page of the assembly list file. (2) noseq information about the options is not output to the first page of the assembly list file. this information cannot be output separately from the assembly list. (3) this option is disabled if /nolist is specified as the assembly list file output control option. 4.5.9 tab control option [format] tab default value...not = 8 notab[=n] when /host is specified...enabled [function] this option specifies whether to use tab characters in the assembly list. [description] (1) tab tab characters are used in the assembly list. if this is selected, assembly is speeded, and the memory capacity required to store the files becomes smaller. (2) not[ab] no tab characters are used in the assembly list. a tab character (if there is one) is replaced with space characters so that the character next to the tab character is at the column that is a multiple of n (as counted from the beginning of the line). "n" is a decimal number, and can range between 1 and 255 (inclusive). if "n" is out of this range, an error is detected, and the assembler is aborted. this option should be used for a printer that cannot recognize the tab character.
part ii chapter 4 assembler functions 96 user ? s manual u10115ej3v0um 4.5.10 form feed control option [format] for[m] default value.../for nof[orm] when /host is specified...enabled [function] this option specifies whether the form of the output list be fed by a form feed character (0ch in 8-bit jis code) or sets of cr/lf characters. [description] (1) for[m] the form of the output list is fed by a form feed character. (2) nof[orm] the form of the output list is fed by outputting cr/lf character sets repeatedly until the value specified in the row option (option to control the number of lines per output list page) is reached. (3) this option should be used for a printer that cannot recognize the form feed character. if for[m] is selected, assembly is speeded, and the memory capacity required to store the files becomes smaller. 4.5.11 option to control assembly-time variables [format] zzzn = m 0 n 9 0h m 0ffffh default value...zzzn = 0 when /host is specified...enabled [function] this option initializes the zzzn assembly-time variable to the value m. [description] (1) the evaluated value of m must fall in a range between 0h and 0ffffh. if it is greater than 0ffffh, it is assumed to be 0. (2) m can be a binary, octal, decimal, or hexadecimal number. if a character string is specified as m, an error (invalid option) is reported, and the assembler is aborted. (3) if the option is not specified when the assembly is started, the assembly-time variables are initially set to 0. this value remains effective until it is changed by a set pseudo instruction.
part ii chapter 4 assembler functions user ? s manual u10115ej3v0um 97 4.5.12 option to control a work drive [format] wor[k] = drive-name: default value...current drive when /host is specified...enabled [function] this option specifies the name of a drive in which assembly work files are prepared. [description] (1) drive name specification only one drive name can be specified. example: work = a: (2) all work files are deleted at the end of assembly. 4.5.13 option to control list header output [format] head default value...head nohead when /host is specified...head [function] this option specifies whether to output the headers of lists such as an assembly list and cross-reference file list. [description] (1) /head the header is output to each page of the list. (2) /nohead the header is output only to the first page of the list. it is not output to the other pages. (3) this option is applicable to the following lists. ? assembly list file ? cross-reference list file
part ii chapter 4 assembler functions 98 user ? s manual u10115ej3v0um 4.5.14 help message display [format] hel[p] [function] this option displays the description of AS6133. [description] this option cannot be specified in the sequence file. it can be specified only in format: AS6133 ? /hel[p]
user?s manual u10115ej3v0um 99 chapter 5 assembly output lists 5.1 types of assembly output lists AS6133 can output the following lists after assembly. table 5-1. output lists output file output file extension assembly option whether the list is output when/host is specified object file .obj /obj pro file .pro /pro assembly list .prn /lis[t] option information list .prn /seq cross-reference list .xrf or .prn /xre[f] log file AS6133.log to output a list mentioned in table 5-1, specify the corresponding assembly option when starting the assembler. see section 4.5 for how to specify it. if it is unnecessary to output a list, prefix the corresponding assembly option with "no" as in /nolist or /noseq.
part ii chapter 5 assembly output lists 100 user?s manual u10115ej3v0um 5.2 controlling each list output format (1) number of lines per page the number of lines per page is determined by the row = n assembly option (where 50 n 250). n is defaulted to 66. (2) number of columns per line the number of columns per line is determined by the col = n assembly option (where 72 n 255). if the specified list output exceeds this value, the excess portion is cut out from listing. if a full-size character falls in the cut position, the cut position is shifted one place backward. n is defaulted to 80. if /host is specified, however, n is fixed at 132. (3) form feed control the form is fed according to the form/noform assembly option. form................ a new page is selected when the ff character is detected (default). noform........... the form is advanced by outputting cr/lf characters repeatedly until the form is advanced as many lines as specified in the row assembly option. note ff (form feed) character ................... 0ch in the 8-bit jis code lf (line feed) character ..................... 0ah in the 8-bit jis code cr (carriage return) character........... 0dh in the 8-bit jis code (4) tab control tab control is carried out according to the tab/notab assembly option. notab = n .............. a tab character is replaced with space characters so that the character next to the tab character is at the column whose number (counted from the beginning of the line) equals a multiple of n (n is defaulted to 8). tab ......................... tab characters are output.
part ii chapter 5 assembly output lists user?s manual u10115ej3v0um 101 5.3 header output lists other than a document list have a header (printed at the top of each page) consisting of the following information: (1) assembler name and version (2) device name (3) listing title (4) assembly date/time and page (module sequence number - page number within the module) (5) module name example: upd6133.asm an assembly option can specify whether to output the header. /head (default) specifies that the header be printed at the top of each assembly list page. /nohead specifies that the header be output at the top of the first page only.
part ii chapter 5 assembly output lists 102 user?s manual u10115ej3v0um 5.4 assembler's check functions the assembler checks each instruction in a source program to minimize errors that may occur when its object program is executed. 5.4.1 error check for instructions exceeding the allowable number of bits the assembler outputs a message if an instruction in a source program exceeds the allowable number of bits. (1) instructions specifying immediate data anl a, #data : error if the number of bits is greater than 4. orl a, #data : error if the number of bits is greater than 4. xrl a, #data : error if the number of bits is greater than 4. out pp, #data : error if the number of bits is greater than 10. if bit 8 or 9 is 1, a warning message is output, and bits 8 and 9 are reset to 0. mov a, #data : error if the number of bits is greater than 4. mov rr, #data : error if the number of bits is greater than 10. if bit 8 or 9 is 1, a warning message is output, and bits 8 and 9 are reset to 0. mov t, #data : error if the number of bits is greater than 10. mov m0, #data : error if the number of bits is greater than 10. mov m1, #data : error if the number of bits is greater than 10. stts #data : error if the number of bits is greater than 4. (2) dt and dw instructions dt instruction : error if the number of bits is greater than 10. dw instruction : error if the number of bits is greater than 10. dw instruction : if bit 8 or 9 is 1, a warning message is output, and bits 8 and 9 are reset to 0. 5.4.2 check to prevent a program crash if the supply voltage fluctuates during operation, or a power-on reset fails to take place, the program counter may become undefined, possibly resulting in a program crash. if the program counter points to an address at which there is no programmed instruction, and the code at that address happens to match the operation code of a jump or halt instruction, an endless loop may result. to prevent a program crash, if the object code pointed to by the program counter happens to match the operation code of a branch or halt instruction, the assembler outputs a warning message and displays an instruction that will be generated. the instructions generated in this case include: jmp, jc, jnc, jf, jnf, call, ret, and halt. if a warning message is output, check the instruction that will be generated. if the instruction can cause an endless loop, the program should be corrected.
part ii chapter 5 assembly output lists user?s manual u10115ej3v0um 103 5.4.3 check for the destination of a branch instruction (automatic check on bank0 and bank1) this check is made for a device in which the number of rom words is greater than 1,024. to branch execution without the bank number at the branch destination described in the mnemonic, describe as follows: ? object code of j 0 or call0 to branch to bank0 (0 to 1,023 instructions) ? object code of j 1 or call1 to branch to bank1 (1,024 to 2,047 instructions) ? object code of j 2 or call2 to branch to bank2 (2,048 to 3,071 instructions) ? object code of j 3 or call3 to branch to bank3 (3,072 instructions or more) if j 0, j 1, j 2, j 3, call0, call1, call2, or call3 is described with a bank number, an error occurs. ? branch instruction source instruction jmp0 jmp1 jmp2 jmp3 addr addr addr addr jmp addr jc0 jc1 jc2 jc3 addr addr addr addr jc addr jnc0 jnc1 jnc2 jnc3 addr addr addr addr jnc addr jf0 jf1 jf2 jf3 addr addr addr addr jf addr jnf0 jnf1 jnf2 jnf3 addr addr addr addr jnf addr ? subroutine instruction source instruction call0 call1 call2 call3 addr addr addr addr call addr
part ii chapter 5 assembly output lists 104 user?s manual u10115ej3v0um 5.4.4 check for output to an input-only port if an output instruction is coded for an input-only port, an error message is output. ? ? ? ? input-only port p11 (ki3 to ki0) p01 (s1/led,s0) ? ? ? ? output instruction out p11, a out p01, a out p1, #data 5.4.5 check for input/output instructions for nonexisting ports a warning message is output if an input or output instruction is coded for a nonexisting port. port device p10 (ki/o7 to ki/o4) p00 (ki/o0 to ki/o3) p11 (ki3 to ki0) p01 s1led s0 p12 i/opull i/omode p02 (i/o3 to i/o0) d6133 d6134 d6135 d6603 note 1 note 2 d6604 d6605 d63 d63a d64 d64a d65 d62 d62a d6132 d6132a d67 d68 d69 : no warning message is output. : a warning message is output. caution refer to the device name of the supported mask rom version device when using the pd61p34b, 66p04b, 6p4b, 6p5, or 6p9. notes 1. d6603 does not have ki/o7 to ki/o5 but a warning message is not output. 2. d6603 does not have s0 but a warning message is not output.
user?s manual u10115ej3v0um 105 chapter 6 error messages 6.1 errors detected at start-up and run time if a parameter specified at start-up is incorrect, or an error occur at run time, AS6133 displays error messages, then stops prematurely. message text file not found cause a file specified at start-up is not found in a specified directory on a specified drive system action AS6133 stops running. user response specify the correct file. message text invalid option cause a specified option is invalid (such as invalid option name or parameter). system action the invalid option is indicated, and assembly is aborted. user response specify the correct option. message text invalid option value cause a value specified for an option is invalid (a value out of the describable range was specified). system action the invalid option is indicated, and assembly is aborted. user response specify the correct option. message text out of memory cause the memory capacity is insufficient. system action assembly is aborted. user response decrease the number of options used, increase memory, or change the /work drive specification. in the following case, a message is displayed, but assembly is not aborted. message text halt table overflow cause the halt area has overflowed. system action there are more than 32 halt instructions, and information about the halt instructions is not preserved. user response decrease the number of the halt instructions.
part ii chapter 6 error messages 106 user?s manual u10115ej3v0um (1) error message format an error message includes a source statement in which the error occurred. the displayed source statement line is followed by a line containing the source file name, line number, error type, error number, and error message text. the error message ends with the numbers of errors and warnings. [example] <1> : source file name <2> : line number <3> : error type 1: rom area overflow 1: a location out of the program memory was referenced. a: addressing error f: include file open error i: invalid operand value in the org pseudo instruction i: invalid data strength i: error related to an include file m: macro management file i/o error m: memory area overflow m: invalid instruction n: nest stack overflow o: mask option definition block error o: duplicate mask option specification o: invalid operand p: invalid pseudo instruction p: invalid statement r: rept area overflow r: a statement was written out of the program memory area. r: a reserved word was used where it should not be. s: duplicate symbol definition or undefined symbol s: symbol area overflow s: syntax stack overflow s: format or syntax error t: invalid operand u: undefined symbol v: invalid operand value or count w: warning inc dirtest.asm (3): s error-number 058: undefined symbol <1> <2> <3> <4> <5> number of errors = 1 number of warnings = 0 source statement in which the error is detected source file name, line number, error message text total numbers of errors and warnings c
part ii chapter 6 error messages user ? s manual u10115ej3v0um 107 <4> : error number <5> : error message text caution the warning messages described in section 5.4.2 may not include a source statement in which an error is detected. message text illegal first operand type cause the first operand is invalid. 11 code o user response correct the expression. message text illegal second operand type cause the second operand is invalid. 12 code o user response correct the expression. message text illegal first operand value cause the first operand value is incorrect. 14 code v user response make sure that the operand value is acceptable to the device model of interest. message text unreference symbol cause the symbol has not been referenced. 20 code w user response check whether the symbol is necessary. if the symbol is unnecessary, delete it. if the symbol is necessary, reference it. message text no if directive cause an if statement is missing. 21 code p user response write an if statement in the correct position. message text symbol define error cause the symbol definition is incorrect. 25 code s user response correct the symbol define pseudo instruction and its operand. message text no option statement cause an option statement is missing. 27 code p user response add an option statement, because an endop statement was specified when an option statement was not. message text no end directive cause an end statement is missing. 28 code p user response add an end statement. message text no endif directive cause an endif is missing. 29 code p user response write an endif statement in the correct position. message text no endr directive cause an endr statement is missing. 31 code p user response write an endr statement in the correct position.
part ii chapter 6 error messages 108 user ? s manual u10115ej3v0um message text no endm directive cause macro has no corresponding endm statement. 32 code p user response write an endm statement in the correct position. message text no endp directive cause an endp statement is missing. 33 code p user response write an endp statement in the correct position. message text nesting overflow cause the nest stack has overflowed. 35 code n user response decrease the total nesting depth of if and rept-endr statements to or below level 40. message text operand count error cause an attempt was made to specify more operands than allowed. 36 code o user response decrease the number of operands. message text syntax error cause there is a syntax error. 37 code s user response correct the statement. message text symbol area overflow cause the symbol area has overflowed. 39 code s user response decrease the number of symbols, or increase the size of the usable memory area. message text invalid endr statement cause the endr statement is invalid. 41 code p user response write the endr statement in the correct position. message text invalid exitr statement cause the exitr statement is invalid. 42 code p user response write the exitr statement in the correct position. message text invalid endm statement cause the endm statement is invalid. 43 code p user response write the endm statement in the correct position. message text invalid value cause there is an invalid value. 44 code v user response correct the value. message text invalid operand cause there is an invalid operand. 45 code t user response correct the operand. message text out of address range (3) cause a statement is written out of the program memory area (3). 47 code r user response shift the statement into the program memory area.
part ii chapter 6 error messages user ? s manual u10115ej3v0um 109 message text used reserved word cause a reserved word is used where it should not be. 49 code r user response do not use a reserved word in the name of a symbol. message text invalid data length cause the data length is invalid. 51 code i user response do not try to use more characters than allowed for the data. message text include nesting error cause there two many include nesting levels. 52 code n user response decrease the number of include nesting levels to within 8. message text duplicated option directive cause there are duplicate option pseudo instruction definitions. 53 code o user response do not write more than one option block in a source program. message text rept area overflow cause the rept area has overflowed. 55 code r user response decrease the number of repeat definition nesting levels to within 8. message text symbol multi defined cause there are duplicate symbol definitions. 57 code s user response use different symbol names. message text undefined symbol cause there is an undefined symbol. 58 code s user response write a defined symbol, or define one. message text invalid pseudo cause there is an invalid pseudo instruction. 59 code p user response correct the pseudo instruction. message text include file open error cause an include file cannot be opened. 61 code f user response specify a correct include file, or expand the memory area. message text parser stack overflow cause the syntax stack area has overflowed. 62 code s user response decrease the nesting depth of ( and ) pairs below level 17 and number of operators below 32. message text statement after end cause an end statement is followed by another statement. 65 code w user response remove the statement after the end statement. message text address error cause a specified address is incorrect. 67 code a user response specify an address that is acceptable to the device model of interest.
part ii chapter 6 error messages 110 user ? s manual u10115ej3v0um message text operation in option block cause a mask option definition block contains an instruction. 68 code w user response remove the instruction. message text illegal first operand type and value cause the value of the first operand is invalid. 71 code o user response correct the operand. message text illegal second operand type and value cause the value of the second operand is invalid. 72 code o user response correct the operand. message text undefined first operand symbol cause the symbol in the first operand is undefined. 74 code u user response use a defined symbol, or define the symbol already used in the operand. message text undefined second operand symbol cause the symbol in the second operand is undefined. 75 code u user response use a defined symbol, or define the symbol already used in the second operand. message text not found mask-option block cause a mask option definition block is missing. 77 code o user response specify a mask option using an option pseudo instruction. message text invalid endp statement cause there is an invalid endp statement. 85 code p user response specify an endp statement that corresponds to public below. message text invalid instruction of last address in program cause the last instruction in the program is neither jmp nor ret. 98 code w user response if the last instruction is not dw or dt, specify either a jmp or ret instruction. message text over max value cause the specified value is greater than an allowable number of bits, file name [address]. 99 code v user response decrease the value to within an allowable number of bits. if a value is determined at linkage time, the file name and address are displayed. message text over effective value cause the specified value is greater than a valid number of bits. 100 code w user response reset the invalid bits to 0. decrease the value to within an allowable number of bits. message text output request for read only port cause an output instruction was specified for an input-only port. 101 code p user response specify an output instruction only for an input/output or output-only port.
part ii chapter 6 error messages user ? s manual u10115ej3v0um 111 message text input/output request for non-existent port cause an input/output instruction was specified for a nonexisting port. 102 code w user response specify the input/output instruction for an existing port. message text same operand value with branch or halt cause an operand value happened to match the operation code of a branch or halt instruction. 103 code w user response a value specified in the second or subsequent operand of an instruction or a value defined in a define instruction happened to match the operation code of a branch or halt instruction. for a branch instruction, the error message contains the branch address. for the halt instruction, the error message contains the operand value. check the operation of an instruction executed after the program counter becomes undefined. message text the source file does not exist in the same directory with seq file cause when the /host option is specified, the source file is not in the same directory as the sequence file. 104 code s user response move the source file to the same directory where the sequence file is. message text too many include file cause there are too many include files. 105 code i user response decrease the number of include files per source file to within 16. message text too long include file name cause there are too many characters in the names of include files. 106 code i user response decrease the number of characters in the include file names per source file to within 255.
user?s manual u10115ej3v0um 112 appendix a constraints this appendix explains the constraints of AS6133 v2.21 or later. no. constraint 1 when /host option is specified, a drive name and a directory name must not be included in the source file name described in the sequence file. also when /noh[ost] option is specified, a relative path must not be specified in specifying a source file name to be described in the sequence file. for the description format of a source file name, see section 3.2.4 . 2 the pd6p4 cannot be used with program memory of 2,016 words.
user?s manual u10115ej3v0um 113 appendix b revision history here is the revision history of this manual. "location" indicates the chapter of the edition. edition major revision from preceding edition location deleting description "separate volume of sm6133" or "supplied with sm6133" because AS6133 assembler is separated from sm6133 simulator. changing supported debugger from nec's sm6133 simulator to naito densei machida mfg's eb-6133 adding pd63 series as target device throughout adding series name and device that can be supported changing description of pc-9800 series, ibm pc/at compatibles, and assembler preface adding usepoc/nousepoc, usecap/nousecap part i language, chapter 3 pseudo instructions and control instructions adding description on supported debugger part ii operation, chapter 1 product overview adding description on install part ii operation, chapter 2 before execution changing device name that can be described and description of supported device part ii operation, chapter 3 sequence file changing description in [example] of assembler start-up procedure part ii operation, chapter 4 assembler functions adding description on instructions specifying immediate data changing description of check for the destination of a branch instruction adding device to check for input/output instructions for nonexisting ports part ii operation, chapter 5 assembly output lists 3rd edition addition appendix a constraints
user?s manual u10115ej3v0um 114 [memo]
although nec has taken all possible steps to ensure that the documentation supplied to our customers is complete, bug free and up-to-date, we readily accept that errors may occur. despite all the care and precautions we've taken, you may encounter problems in the documentation. please complete this form whenever you'd like to report errors or suggest improvements to us. hong kong, philippines, oceania nec electronics hong kong ltd. fax: +852-2886-9022/9044 korea nec electronics hong kong ltd. seoul branch fax: +82-2-528-4411 taiwan nec electronics taiwan ltd. fax: +886-2-2719-5951 address north america nec electronics inc. corporate communications dept. fax: +1-800-729-9288 +1-408-588-6130 europe nec electronics (europe) gmbh technical documentation dept. fax: +49-211-6503-274 south america nec do brasil s.a. fax: +55-11-6462-6829 asian nations except philippines nec electronics singapore pte. ltd. fax: +65-250-3583 japan nec semiconductor technical hotline fax: +81- 44-435-9608 i would like to report the following error/make the following suggestion: document title: document number: page number: thank you for your kind support. if possible, please fax the referenced page or drawing. excellent good acceptable poor document rating clarity technical accuracy organization cs 01.2 name company from: tel. fax facsimile message


▲Up To Search▲   

 
Price & Availability of AS6133

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X